how to find out position of minimum element in a matrix
조회 수: 6 (최근 30일)
이전 댓글 표시
a=[8 2 5;2 -2 4;9 5 4] here position of minimum value is 2*2
댓글 수: 0
채택된 답변
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
추가 답변 (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!