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?

Respuestas (2)

Image Analyst
Image Analyst el 30 de Sept. de 2012

1 voto

You can use the ismember(), hist(), or histc() functions.
bym
bym el 30 de Sept. de 2012
one way
x = randi(10,100,1); %example data
>> sum(x==5)
ans =
8

Categorías

Más información sobre Polynomials en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Sept. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by