Azzera filtri
Azzera filtri

Hi,,I am trying to calculate the weight of a matrix.how can i do that> I am explaining below

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

the cyclist
the cyclist il 31 Mag 2016
numberOfColumnsThatHaveExactlyOneOne = sum(sum(A==1)==1);
  3 Commenti

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by