I have this cell array in MATLAB:
y = { \'d\' \'f\' \'a\' \'g\' \'g\' \'a\' \'w\' \'h\'}
I use unique(y) to get rid of the dup
Here's one solution that uses some additional input and output arguments that UNIQUE has:
>> y = { 'd' 'f' 'a' 'g' 'g' 'a' 'w' 'h'}; %# Sample data
>> [~,index] = unique(y,'first'); %# Capture the index, ignore the actual values
>> y(sort(index)) %# Index y with the sorted index
ans =
'd' 'f' 'a' 'g' 'w' 'h'