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 Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by