Locating matrix position of maximum value

조회 수: 5 (최근 30일)
John
John 2011년 9월 16일
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?

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by