Get the value from coloumn correspond to the another coloimn max element
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Konstantin Shchukin
am 17 Jul. 2022
Beantwortet: Star Strider
am 17 Jul. 2022
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 Kommentare
Akzeptierte Antwort
Star Strider
am 17 Jul. 2022
Try this —
M = rand(10,2)
[Col1Max,idx] = max(M(:,1))
Result = M(idx,2)
.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!