how can i count a cell in a randi vector

2 visualizaciones (últimos 30 días)
adir weiser
adir weiser el 22 de Jul. de 2018
Editada: Paolo el 22 de Jul. de 2018
hi, i have a randi vector like: randi(4,1,50). and i need to count who much time the number '1' appear in my vector. as well the number '2' and '3' and '4'
thanks alot

Respuestas (1)

Paolo
Paolo el 22 de Jul. de 2018
Editada: Paolo el 22 de Jul. de 2018
histcounts(randi(4,1,50))
The output of the function is the occurrences of numbers one to four respectively.

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by