unique command

2 Ansichten (letzte 30 Tage)
huda nawaf
huda nawaf am 19 Nov. 2011
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

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 19 Nov. 2011
x = randi(8,15,1)
a = unique(x)
number_of_frequent = histc(x,a)
out = [a number_of_frequent]

Weitere Antworten (0)

Kategorien

Mehr zu Fractals finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by