Filter löschen
Filter löschen

Locating matrix position of maximum value

2 Ansichten (letzte 30 Tage)
John
John am 16 Sep. 2011
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?

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 16 Sep. 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 Kommentar
Andrei Bobrov
Andrei Bobrov am 16 Sep. 2011
http://www.mathworks.com/matlabcentral/answers/15806-returning-largest-and-smallest-values-in-the-array

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by