locating the relative position of a value in a 2 x matrix
2 次查看(过去 30 天)
显示 更早的评论
I have a 180 by 180 matrix and want to locate the position of the minimum value so I can subsequently reuse the source variables used in the creation of that matrix.
i.e. the minimum valur occurs at row 10 and column 130 but I have not been able to simply return those two numbers.
0 个评论
采纳的回答
更多回答(3 个)
Daniel Shub
2012-5-22
From an understanding point, maybe this is better
x = randn(180);
[y, I] = min(x);
[~, J] = min(y);
[I(J), J]
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!