How to get Index of matrix after Max and Min
조회 수: 1 (최근 30일)
이전 댓글 표시
for example
a=[1 2 3; 4 5 6];
b=max(min(a);
what i want,
for min(a)=[1 4]' , index(1,1 2,1)
b=max(min(a))= 4 , index as 2,1
how can i do this? i require the final index as said above. what is the code for it.
댓글 수: 0
답변 (1개)
Mischa Kim
2014년 4월 15일
편집: Mischa Kim
2014년 4월 15일
Praveen, use something like
ind = arrayfun(@(ii) find(a(ii,:)==min(a(ii,:),[],2)),1:size(a,1));
to get the column indices of the row minima, and
[r c] = find(a == max(min(a,[],2)));
댓글 수: 3
참고 항목
카테고리
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!