How do I count the numbers of 0s and display the results?

Hi all,
How do I count the numbers of 0s in the results as shown below and display the results?
Thank you
Columns 1 through 12
0 0 0 0 0 0 0 0 0 0 0 0
Columns 13 through 20
0 0 0 0 0 0 0 0

 Réponse acceptée

José-Luis
José-Luis le 14 Oct 2012
Modifié(e) : José-Luis le 14 Oct 2012
your_val = sum(your_mat(:)==0);

Catégories

En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by