Locating matrix position of maximum value
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a large matrix with many numbers. I would like to calculate the max and min values as well as the cell location (m,n) of each of these values. How can I do this?
0 Commenti
Risposta accettata
Fangjun Jiang
il 16 Set 2011
Use the full return argument of min and max
[Y,I] = MAX(X)
a=magic(10);
[Value,Ind]=max(a(:))
[M,N]=ind2sub(size(a),Ind)
1 Commento
Andrei Bobrov
il 16 Set 2011
http://www.mathworks.com/matlabcentral/answers/15806-returning-largest-and-smallest-values-in-the-array
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!