Find first non-zero column of a matrix
Ältere Kommentare anzeigen
How do I, given a matriz A, tell MATLAB to find the index of the leftmost non-zero column of said matrix?
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 27 Aug. 2016
A=randi([0 2],20,8)
[~,out]=max(sum(logical(A)))
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!