필터 지우기
필터 지우기

How can I count the number of vector elements without repetition?

조회 수: 3 (최근 30일)
Hadeer Mostafa
Hadeer Mostafa 2016년 11월 11일
답변: dpb 2016년 11월 11일
Hi, I have a vector that contains repeated elements, How can I count the number of vector elements without repetition?
For example: a=[2 5 2 8 9 8 7 8 1]; I expect the result will be: count = 6

채택된 답변

dpb
dpb 2016년 11월 11일
>> na=[2 5 2 8 9 8 7 8 1];
>> length(unique(na))
ans =
6
>>

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by