How many times specific element occurs in each column of a given matrix

1 次查看(过去 30 天)
Hi all. Assume that I have a big matrix and I want to calculate how many times a specific element, for instance 0, occurs in each column of that matrix and then store those values in a row vector ? Is there a way of doing that ? Thank you.

采纳的回答

Stephen23
Stephen23 2017-7-6
编辑:Stephen23 2017-7-6
V = sum(M==0,1)
where M is your matrix.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by