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?

Antworten (2)

Image Analyst
Image Analyst am 30 Sep. 2012

1 Stimme

You can use the ismember(), hist(), or histc() functions.
bym
bym am 30 Sep. 2012

0 Stimmen

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

Kategorien

Mehr zu Elementary Math finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 30 Sep. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by