Minimum of a 3X3 matrix

조회 수: 1 (최근 30일)
Ken
Ken 2016년 10월 21일
편집: Star Strider 2016년 10월 21일
I am trying to find the min and the indices of the min in a 3X3 matrix. want to use a variation of "find(arr == max(arr));"
Kindly help

채택된 답변

Star Strider
Star Strider 2016년 10월 21일
편집: Star Strider 2016년 10월 21일
Two possible approaches:
A = rand(3); % Create Data
[Amin,idx] = min(A(:)); % One Option
[r,c] = ind2sub(size(A), idx)
[r,c] = find(A == min(A(:))) % Another Option
Amin = A(r,c)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by