Filter löschen
Filter löschen

total number of elements which are not zero

1 Ansicht (letzte 30 Tage)
Mate 2u
Mate 2u am 20 Jul. 2012
I have a matrix "Percey" of size 294x34. I want a new matrix "B" which is 294x1 where each row the number of numbers which are not 0 are counted.
Thanks

Akzeptierte Antwort

Wolfgang Schwanghart
Wolfgang Schwanghart am 20 Jul. 2012
Hi, what about:
B = sum(Percey~=0,2);
Regards, W.

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by