help how can I find the minimum number and return it's index in each row?
이전 댓글 표시
help how can I find the minimum number and return it's index in each row?
채택된 답변
추가 답변 (1개)
Guillaume
2014년 11월 13일
To find the minimum of a row, use:
min(m, [], 2)
Probably, the simplest way to ignore 0s is to replace them with NaNs before calling min.
m(m == 0) = nan;
[mval, mcol] = min(m, [], 2);
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!