I WANT TO SOLVE THIS PROBLEM
조회 수: 1 (최근 30일)
이전 댓글 표시
I want select max value from very row
like this until 364
댓글 수: 0
채택된 답변
Walter Roberson
2015년 8월 22일
[maxvals, maxidx] = max(YourMatrix, [], 2);
Now maxidx will be a vector of column numbers, one per row.
댓글 수: 4
Walter Roberson
2015년 8월 23일
The 2 refers to dimension #2, the columns . The above functions equivalently to
for K = 1 : size(YourMatrix,1)
[maxvals(K,1), maxidx(K,1)] = max(YourMatrix(K,:),[]);
end
If you left out the 2, then the default would be to work along the first non-singular dimension, like
for K = 1 : size(YourMatrix,2)
[maxvals(1,K), maxidx(1,K)] = max(YourMatrix(:,K),[]);
end
추가 답변 (0개)
참고 항목
카테고리
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!