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

2 visualizzazioni (ultimi 30 giorni)
Portgas Ace
Portgas Ace il 30 Set 2012
Is there a specific 'find' function wherein i can check how many times a string/number is in an array?

Risposte (2)

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

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

Categorie

Scopri di più su Polynomials in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by