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!