From: Bi on
Hello Guys,
I have an array e.g, [1 10 20 18 10 9 15 2 1 18] (generated by uniform distribution unidrnd)
Is there anyway to find indexes of elements that are not repeated in the array, that say 3, 6, 7, 8 ?

Thanks a lot in advanced!
From: dpb on
Bi wrote:
> Hello Guys,
> I have an array e.g, [1 10 20 18 10 9 15 2 1 18] (generated by uniform
> distribution unidrnd)
> Is there anyway to find indexes of elements that are not repeated in the
> array, that say 3, 6, 7, 8 ?
>
> Thanks a lot in advanced!

doc unique

--
From: Bruno Luong on
"Bi " <chuyenbk2002ster(a)gmail.com> wrote in message <hqb79n$53t$1(a)fred.mathworks.com>...
> Hello Guys,
> I have an array e.g, [1 10 20 18 10 9 15 2 1 18] (generated by uniform distribution unidrnd)
> Is there anyway to find indexes of elements that are not repeated in the array, that say 3, 6, 7, 8 ?

a= [1 10 20 18 10 9 15 2 1 18]

[u I J]=unique(a(:));
I(accumarray(J,1)==1) % sort() it if you prefer

% Bruno
From: us on
"Bi " <chuyenbk2002ster(a)gmail.com> wrote in message <hqb79n$53t$1(a)fred.mathworks.com>...
> Hello Guys,
> I have an array e.g, [1 10 20 18 10 9 15 2 1 18] (generated by uniform distribution unidrnd)
> Is there anyway to find indexes of elements that are not repeated in the array, that say 3, 6, 7, 8 ?
>
> Thanks a lot in advanced!

a hint:

help unique;

us