From: Gonzalo on
Hi all,

Does anybody know how to generate a series of say 450 non-repeating random integers between 0 and 2000?

Thanks
From: Roger Stafford on
"Gonzalo " <glpita(a)gmail.com> wrote in message <htk4jc$4nh$1(a)fred.mathworks.com>...
> Hi all,
>
> Does anybody know how to generate a series of say 450 non-repeating random integers between 0 and 2000?
>
> Thanks

p = randperm(2001);
p = p(1:450)-1;

Roger Stafford
From: kk KKsingh on
"Gonzalo " <glpita(a)gmail.com> wrote in message <htk4jc$4nh$1(a)fred.mathworks.com>...
> Hi all,
>
> Does anybody know how to generate a series of say 450 non-repeating random integers between 0 and 2000?
>
> Thanks

A SIMPLE SOLUTION
r=randperm(2000);
m=450;
r=r(1:450);
From: Gonzalo on
"kk KKsingh" <akikumar1983(a)gmail.com> wrote in message <htk5qr$nos$1(a)fred.mathworks.com>...
> "Gonzalo " <glpita(a)gmail.com> wrote in message <htk4jc$4nh$1(a)fred.mathworks.com>...
> > Hi all,
> >
> > Does anybody know how to generate a series of say 450 non-repeating random integers between 0 and 2000?
> >
> > Thanks
>
> A SIMPLE SOLUTION
> r=randperm(2000);
> m=450;
> r=r(1:450);

Thanks a lot guys,