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

1 回表示 (過去 30 日間)
Yao
Yao 2012 年 10 月 14 日
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

採用された回答

José-Luis
José-Luis 2012 年 10 月 14 日
編集済み: José-Luis 2012 年 10 月 14 日
your_val = sum(your_mat(:)==0);

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 11 月 2 日
numel(your_mat) - nnz(your_mat)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by