MATLAB: Unique values inside a matrix

matrixunique

Hello,
Assuming i have a matrix like this m=
1 30
1 20
1 20
1 20
2 30
2 28
2 28
… …
i want it to be like this:
1 30
1 20
2 30
2 28
PS: THE MATRIX IS HUGE CONSISTING OF 11000 ROWS AND 9 COLUMNS
unique is not working since it has it's taking a unique value of all, for example if i apply it for the second column it will take 28 for 1 and not for 2
thank you in advance

Best Answer

Try this:
A = [1 30
1 20
1 20
1 20
2 30
2 28
2 28];
Out = unique(A, 'rows', 'stable')
producing:
Out =
1 30
1 20
2 30
2 28
Experiment to get different results.