M = min(A,[],dim) returns the smallest elements along dimension dim. For example, if A is a matrix, then min(A,[],2) is a column vector containing the minimum value of each row
M = mean(A,dim) returns the mean along dimension dim. For example, if A is a matrix, then mean(A,2) is a column vector containing the mean of each row.
注意格式的区别 不要搞混
eg:A =
1.7000 1.2000 1.5000
1.3000 1.6000 1.9900
Find the minimum of each row.
[M,I] = min(A,[],2)
M =
1.2000
1.3000
I =
2
1