필터 지우기
필터 지우기

How can I find the maximum value in a matrix?

조회 수: 42 (최근 30일)
Ayob
Ayob 2013년 6월 14일
How can I find the maximum value in a matrix and find its column and row number of this value?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 6월 14일
A = randi(100,7,6); % your matrix
v = max(A(:)); % value
[ii,jj] = find(A == v); % row and column number

추가 답변 (1개)

Image Analyst
Image Analyst 2013년 6월 14일
maxValue = max(yourMatrix);
[row column] = find(yourMatrix==maxValue);
Or you can take the second returned argument from max() and use ind2sub().

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by