How to find the indices of elements in an array?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a 103x103 array of values, in which i have to take the smallest values and get the respective (i,j) indices of those values. Can someone help me out with this problem.
댓글 수: 0
채택된 답변
KALYAN ACHARJYA
2021년 2월 23일
편집: KALYAN ACHARJYA
2021년 2월 24일
[r,c]=find(matrix==min(matrix(:)))
#Added
Get the values
matrix(matrix==min(matrix(:)))
추가 답변 (1개)
KSSV
2021년 2월 23일
A = rand(100) ;
[val,idx] = min(A(:)) ;
[i,j] = ind2sub(size(A),idx) ;
val
A(i,j)
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!