help with max function
2 ビュー (過去 30 日間)
古いコメントを表示
[Max,index]=max(array,[ ],2)..... Iam using this syntax to find the maximum value of every column but in case of two equal maximum values it returns the first one... how can I solve this?! Thanks
5 件のコメント
Mohymen Kushal
2020 年 10 月 26 日
if A is a matrix, then max(A,[ ],2) is a column vector containing the maximum value of each row . What is this '2' for ? can anybody explain please. Thanks.
the cyclist
2020 年 10 月 29 日
As clearly stated in the documentation for max, that "2" indicates the matrix dimension along which to take the maximum.
採用された回答
the cyclist
2020 年 2 月 10 日
This code will return the row and column indices where the entry is equal to the column's maximum.
[rowIdx,colIdx] = find(A==max(A))
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!