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

1 回表示 (過去 30 日間)
Damian Wierzbicki
Damian Wierzbicki 2017 年 7 月 6 日
コメント済み: Damian Wierzbicki 2017 年 7 月 6 日
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 Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by