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

1 visualización (últimos 30 días)
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.

Respuesta aceptada

Stephen23
Stephen23 el 6 de Jul. de 2017
Editada: Stephen23 el 6 de Jul. de 2017
V = sum(M==0,1)
where M is your matrix.

Más respuestas (0)

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by