From: james bejon on
Is there a way of not collecting values that are returned from a function? The reason I ask is because the function 'unique' returns 3 arrays, and I'm only really interested in the last one. I was hoping something like

[, , x] = unique(A)

might do the job, but apparently not. Does anyone have any ideas? (Or does a function that does a similar thing exist elsewhere?)
From: us on
"james bejon" <jamesbejon(a)yahoo.co.uk> wrote in message <hou25a$k3m$1(a)fred.mathworks.com>...
> Is there a way of not collecting values that are returned from a function? The reason I ask is because the function 'unique' returns 3 arrays, and I'm only really interested in the last one. I was hoping something like
>
> [, , x] = unique(A)
>
> might do the job, but apparently not. Does anyone have any ideas? (Or does a function that does a similar thing exist elsewhere?)

this has been discussed ad nauseam - not long ago...

one of the solutions

[ix,ix,ix]=unique(1:3);
% -or- sadly (since r2009b or so)
[~,~,ix]=unique(1:3);

us