How to Determine Column(s) with Most Non-zero values in a matrix?
Mostrar comentarios más antiguos
I have a matrix filled with zeros and ones (a black and white image). Most colums are filled with zeros and I want to find which columns has the most ones in them for position determining. How can I do this efficiently?
Respuestas (1)
Azzi Abdelmalek
el 30 de Jun. de 2015
Editada: Azzi Abdelmalek
el 30 de Jun. de 2015
A=randi([0 1],8)
[~,idx]=max(sum(A))
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!