Filter löschen
Filter löschen

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)
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

Akzeptierte Antwort

the cyclist
the cyclist am 31 Mai 2016
numberOfColumnsThatHaveExactlyOneOne = sum(sum(A==1)==1);
  3 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

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!

Translated by