Get the value from coloumn correspond to the another coloimn max element
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Konstantin Shchukin
il 17 Lug 2022
Risposto: Star Strider
il 17 Lug 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 Commenti
Risposta accettata
Star Strider
il 17 Lug 2022
Try this —
M = rand(10,2)
[Col1Max,idx] = max(M(:,1))
Result = M(idx,2)
.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Medical Physics in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!