フィルターのクリア

function similar to count

6 ビュー (過去 30 日間)
SSG_newbiecoder
SSG_newbiecoder 2017 年 12 月 26 日
コメント済み: SSG_newbiecoder 2017 年 12 月 26 日
Is there any function similar to count that can be used in an array of 1's,-1's and 0's to count the number of 1's present in a particular range?
  1 件のコメント
Birdman
Birdman 2017 年 12 月 26 日
Check my answer.

サインインしてコメントする。

採用された回答

Birdman
Birdman 2017 年 12 月 26 日
One approach:
A=randi([-1 1],1,100);%random data for -1,0 and 1
cnt=sum(ismember(A,1));%counts the number of 1 in array A
  1 件のコメント
SSG_newbiecoder
SSG_newbiecoder 2017 年 12 月 26 日
Thank you :)

サインインしてコメントする。

その他の回答 (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