total number of elements which are not zero

5 次查看(过去 30 天)
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
Hi, what about:
B = sum(Percey~=0,2);
Regards, W.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by