Need help using the count function
2 ビュー (過去 30 日間)
古いコメントを表示
hi lets say i have an array 4x5 and it is compossed of 0's and 1's
as so a=[ 1 0 1 0 1;
1 1 0 1 1;
0 1 0 1 0;
1 0 1 0 1;]
and i want to count the zeros in each collumn
so im writing count(a,0) but i am getting erros ive read the material but dont understand what the string array means
0 件のコメント
採用された回答
Walter Roberson
2019 年 10 月 9 日
sum(a == 0, 1)
count() is primarily a method for processing string() datatype.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!