Search This Blog

Wednesday, May 29, 2013

Find unique values of a cell vector without sorting the result in MATLAB

%you can use optional outputs.

a=round(10*rand(1,10))

[dummy I]=unique(a,'first');

u=a(sort(I));


%--Ajay