MATLAB: How to count the numbers of 0s and display the results

countersloops

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

Best Answer

your_val = sum(your_mat(:)==0);