What does ''all'' mean in M = min(A, []. ''all'') ?
古いコメントを表示
M = min(A, []. ''all'')
A is a 4x4 matrix, may I know what does ''all'' means in this command?
I tried it once on Matlab, it returns the smalllest value of the matrix but it does not work in the calculation I am working on.
In fact, min(min(A)) leads to the answer I want, which is the smallest element. So what does ''all'' means in this case?
採用された回答
その他の回答 (1 件)
Vladimir Sovkov
2020 年 7 月 31 日
0 投票
All this is fairly well described in the matlab documentation. min(min(A)) and min(A, [], ''all'') are equivalent for 1D and 2D arrays but differ for bigger dimensions.
3 件のコメント
Vladimir Sovkov
2020 年 7 月 31 日
I also think that as min(A, [], ''all'') calls the min function only once, it works faster, though I have not checked it.
xxtan1
2020 年 7 月 31 日
Vladimir Sovkov
2020 年 7 月 31 日
One more version totally equivalent to min(A, [], ''all'') can be min(A(:)).
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!