Get the value from coloumn correspond to the another coloimn max element
1 回表示 (過去 30 日間)
古いコメントを表示
I have a matrix n x 2. In the first coloumn some value is maximal. How can I get a value from the second coloumn which corresponses to the max value from the first coloumn?
0 件のコメント
採用された回答
Star Strider
2022 年 7 月 17 日
Try this —
M = rand(10,2)
[Col1Max,idx] = max(M(:,1))
Result = M(idx,2)
.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!