Which row has the minimum non zero element?
이전 댓글 표시
Hello i have a matrix and i want to find which is the row with minimum nonzeros elements.I dont want the number of non zeros,but i want to know which is the row.
채택된 답변
추가 답변 (2개)
Jan
2015년 3월 21일
M = randi(5, 6, 6) - 1;
[V, Index] = min(sum(M == 0, 2));
Konstantinos Sofos
2015년 3월 21일
a = [2,2,3;0,2,5;1 2 3]
[row,column]=find(a==min(min(a(a>0))))
카테고리
도움말 센터 및 File Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!