Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Hi I have m by n matrix,I want to find the index of the max. of each column.It can be found by [i j]:max(x,[],2).this gives the index of max of each column in vector i.I want if there is a repetion in vector i to be reset to 0.thanks
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi I have m by n matrix,I want to find the index of the max. of each column.It can be found by [i j]:max(x,[],2).this gives the index of max of each column in vector i.I want if there is a repetion in vector i to be reset to 0.thanks
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2013년 11월 11일
편집: Azzi Abdelmalek
2013년 11월 11일
m=[1 2 3;0 5 6;2 1 7;0 4 9]
[ii,jj]=max(m)
%[ii ji]=max(x,[],2) gives the max of each row
댓글 수: 6
Azzi Abdelmalek
2013년 11월 11일
No, you are looking for the max of each row, to find the maximum of each column
[ii ,jj]=max(r)
%or
[ii, jj]=max(r,[],1)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!