locating the relative position of a value in a 2 x matrix
조회 수: 1 (최근 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에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!