Find first non-zero column of a matrix
Mostrar comentarios más antiguos
How do I, given a matriz A, tell MATLAB to find the index of the leftmost non-zero column of said matrix?
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 27 de Ag. de 2016
A=randi([0 2],20,8)
[~,out]=max(sum(logical(A)))
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!