MATLAB: What's [Y,I]=max(AS,[],2);?

后端 未结 5 1230
傲寒
傲寒 2021-01-20 17:37

I just started matlab and need to finish this program really fast, so I don\'t have time to go through all the tutorials.

can someone familiar with it please explain

5条回答
  •  一个人的身影
    2021-01-20 18:29

    According to the reference manual,

    C = max(A,[],dim) returns the largest elements along the dimension of A specified by scalar dim. For example, max(A,[],1) produces the maximum values along the first dimension (the rows) of A.

    [C,I] = max(...) finds the indices of the maximum values of A, and returns them in output vector I. If there are several identical maximum values, the index of the first one found is returned.

    I think [] is there just to distinguish itself from max(A,B).

提交回复
热议问题