Hi,,I am trying to calculate the weight of a matrix.how can i do that> I am explaining below
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
nafila aytija
am 31 Mai 2016
Kommentiert: the cyclist
am 2 Jun. 2016
Suppose I have a matrix...
A = [1 0 0 0 ;
1 1 0 0 ;
1 1 1 0 ;
1 1 1 1]
how do I calculate that how many coulmns have only one ONE ? TIA
0 Kommentare
Akzeptierte Antwort
the cyclist
am 31 Mai 2016
numberOfColumnsThatHaveExactlyOneOne = sum(sum(A==1)==1);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!