Find the number of times a number is in an array.

1 vue (au cours des 30 derniers jours)
Portgas Ace
Portgas Ace le 30 Sep 2012
Is there a specific 'find' function wherein i can check how many times a string/number is in an array?

Réponses (2)

Image Analyst
Image Analyst le 30 Sep 2012
You can use the ismember(), hist(), or histc() functions.

bym
bym le 30 Sep 2012
one way
x = randi(10,100,1); %example data
>> sum(x==5)
ans =
8

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by