Matlab--求矩阵A某行的和
求矩阵A某行的和
A = [1,2,3;4,5,6;7,8,9]
B=sum(A,2)
B(2)
A =
1 2 3
4 5 6
7 8 9
B =
6
15
24
ans =
15
A = [1,2,3;4,5,6;7,8,9]
B=sum(A,2)
B(2)
A =
1 2 3
4 5 6
7 8 9
B =
6
15
24
ans =
15