max value
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
et's suppose i have an array like:
x = [1 2 35 33]
and i'd like to find which element is the max element of this array...
i mean max(x) = 35 but i do not know the row of the max value but in x it's the third element. but if i do not know this how can i find?
thanks for your helps
0 Kommentare
Akzeptierte Antwort
Matt Fig
am 22 Mär. 2011
Better to use the capabilities of MAX, than to use FIND and a comparison.
[mx,I] = max(x); % mx is the maximum value, I is the location.
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Matrices and Arrays 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!