Find first non-zero column of a matrix
Afficher commentaires plus anciens
How do I, given a matriz A, tell MATLAB to find the index of the leftmost non-zero column of said matrix?
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 27 Août 2016
A=randi([0 2],20,8)
[~,out]=max(sum(logical(A)))
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!