Show all indices of I in [C,I] = max(...)
2 ビュー (過去 30 日間)
古いコメントを表示
I am trying to show all of the row values that share a maximum value of a certain column. How do I show all indices for this instead of just the first index?
A sample array would look like:
1 9
2 9
3 4
4 5
I need an output of I = 1 and I = 2 because they share the max value of nine.
0 件のコメント
採用された回答
Walter Roberson
2019 年 10 月 7 日
target_value = max(TheColumn);
find(TheColumn == target_value)
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!