Calculate unique number for each type

1 Ansicht (letzte 30 Tage)
Billie Jaya
Billie Jaya am 20 Dez. 2018
Beantwortet: madhan ravi am 20 Dez. 2018
Hi guys,
I need help to count duplicate number for each type
The example of the result is like this :
X = Input
Y = Output
X=[2 ;2 ;1 ;3 ;5; 4]
Y= [1 1;2 2;3 1; 4 1; 5 1]
X=[2 ;2 ;2 ;3 ;5; 4]
Y= [1 0;2 3;3 1; 4 1; 5 1]
Can someone help me? thanks

Antworten (1)

madhan ravi
madhan ravi am 20 Dez. 2018
u=unique(X);
Y=[u histc(X,u)]

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by