Locating matrix position of maximum value
2 ビュー (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
採用された回答
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
2011 年 9 月 16 日
http://www.mathworks.com/matlabcentral/answers/15806-returning-largest-and-smallest-values-in-the-array
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!