how to find out position of minimum element in a matrix
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
a=[8 2 5;2 -2 4;9 5 4] here position of minimum value is 2*2
0 Commenti
Risposta accettata
Rik
il 7 Mag 2018
a=[8 2 5;2 -2 4;9 5 4] ;
[r,c]=find(a==min(a(:)));
This will even work if there are multiple positions where the minimum value exists: in that case r and c will be vectors.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Resizing and Reshaping Matrices 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!