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

 채택된 답변

Cedric
Cedric 2013년 11월 1일
편집: Cedric 2013년 11월 1일
doc unique
doc length
and you'll find a simple solution using both functions

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2013년 11월 1일

댓글:

2013년 11월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by