How to Determine Column(s) with Most Non-zero values in a matrix?
Ältere Kommentare anzeigen
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?
Antworten (1)
Azzi Abdelmalek
am 30 Jun. 2015
Bearbeitet: Azzi Abdelmalek
am 30 Jun. 2015
A=randi([0 1],8)
[~,idx]=max(sum(A))
Kategorien
Mehr zu Creating and Concatenating Matrices 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!