给你个参考
>> A=[1 2;3 4]
A =
1 2
3 4
>> B=sum(A)
B =
4 6
>> C=[A(:,1)/B(1),A(:,2)/B(2)]
C =
0.2500 0.3333
0.7500 0.6667