how to find out position of minimum element in a matrix

19 ビュー (過去 30 日間)
Joy Mondal
Joy Mondal 2018 年 5 月 7 日
回答済み: Rik 2018 年 5 月 7 日
a=[8 2 5;2 -2 4;9 5 4] here position of minimum value is 2*2

採用された回答

Rik
Rik 2018 年 5 月 7 日
a=[8 2 5;2 -2 4;9 5 4] ;
[r,c]=find(a==min(a(:)));
This will even work if there are multiple positions where the minimum value exists: in that case r and c will be vectors.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by