I have a vector Y=[1, 1, 1, 2, 2, 2,2,2, 3, 3, 3,4]. How can I make matlab tell that the total number of values that are different from each other in the vector is 4? thank you very much

I have a vector Y=[1, 1, 1, 2, 2, 2,2,2, 3, 3, 3,4]. How can I make matlab tell that the total number of values that are different from each other in the vector is 4? thank you very much

 Respuesta aceptada

Cedric
Cedric el 1 de Nov. de 2013
Editada: Cedric el 1 de Nov. de 2013
doc unique
doc length
and you'll find a simple solution using both functions

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 1 de Nov. de 2013

Comentada:

el 1 de Nov. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by