The default behavior when using unique() with the 'stable' option is to return the indices to the first occurrence of each unique value. In case I want the last occurrence I would expect to use 'last' in conjunction with 'stable' option but the function doesn't allow me to use the two, it's either 'stable', or 'last'. Was the function designed to behave like this, or am I misunderstanding the usage?
This is what I'm trying to do
[C,ia,ic] = unique(A,'stable','last')
Best Answer