unique command

조회 수: 20 (최근 30일)
huda nawaf
huda nawaf 2011년 11월 19일
hi,
is there command with unique compute the number of frequent for each value? i.e
unique =[10 2 4 5 6] no of itrations= [2 8 1 2 10];
that is meaning the no. of frequent
10 is 2
2 is 8
4 is 1
etc.
thanks

채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 11월 19일
x = randi(8,15,1)
a = unique(x)
number_of_frequent = histc(x,a)
out = [a number_of_frequent]

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by