total number of elements which are not zero

2 ビュー (過去 30 日間)
Mate 2u
Mate 2u 2012 年 7 月 20 日
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

採用された回答

Wolfgang Schwanghart
Wolfgang Schwanghart 2012 年 7 月 20 日
Hi, what about:
B = sum(Percey~=0,2);
Regards, W.
  1 件のコメント
Mate 2u
Mate 2u 2012 年 7 月 20 日
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by