都是很简单的东西,但是爱忘,所以写下来..闲话不多说,只给例子.
>> AA = 3 4 2 1 5 3 4 7 1
>> sum(A)ans = 8 16 6
>> sum(A,2)ans = 9 9 12>> sum(A,1)ans = 8 16 6>> A(:,2)ans = 4 5 7