how can i find the location of the largest element in a 2-D matrix not in a column or row matrix?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
NAVNEET NAYAN
am 9 Dez. 2016
Kommentiert: NAVNEET NAYAN
am 9 Dez. 2016
I was getting a 1080-by-1920 matrix and i have to find the location of the largest value of the matrix, so how can i find it. I have already found the largest value from that matrix, but couldnot trace it's location.
0 Kommentare
Akzeptierte Antwort
Mischa Kim
am 9 Dez. 2016
Navneet, e.g.
A = [1 2 3; 2 3 4; 3 2 1]
A =
1 2 3
2 3 4
3 2 1
[row,col] = find(A == max(max((A))))
row =
2
col =
3
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices 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!