Calculate unique number for each type

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

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2018b

Asked:

on 20 Dec 2018

Answered:

on 20 Dec 2018

Community Treasure Hunt

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

Start Hunting!