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.

采纳的回答

Walter Roberson
Walter Roberson 2019-10-7
target_value = max(TheColumn);
find(TheColumn == target_value)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by