Which row has the minimum non zero element?
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (2)
Jan
am 21 Mär. 2015
M = randi(5, 6, 6) - 1;
[V, Index] = min(sum(M == 0, 2));
Konstantinos Sofos
am 21 Mär. 2015
a = [2,2,3;0,2,5;1 2 3]
[row,column]=find(a==min(min(a(a>0))))
Kategorien
Mehr zu Analysis of Variance and Covariance finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!