Find the number of times a number is in an array.
古いコメントを表示
Is there a specific 'find' function wherein i can check how many times a string/number is in an array?
回答 (2 件)
Image Analyst
2012 年 9 月 30 日
1 投票
You can use the ismember(), hist(), or histc() functions.
bym
2012 年 9 月 30 日
one way
x = randi(10,100,1); %example data
>> sum(x==5)
ans =
8
カテゴリ
ヘルプ センター および File Exchange で Elementary Math についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!