Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: array with random not repeated numbers
Replies: 9   Last Post: Jun 7, 2011 2:44 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Patrick Diviacco

Posts: 23
Registered: 9/15/09
Re: array with random not repeated numbers
Posted: Nov 10, 2009 6:49 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <45a8dd1f-8806-4903-ac8f-6a25382539f0@j19g2000vbi.googlegroups.com>...
> On Nov 10, 5:04?pm, "Patrick Diviacco" <patrick.divia...@gmail.com>
> wrote:

> > hi,
> >
> > how can I generate an array with random numbers (given a min and max) ?
> > Important: they have to be not repeated.
> >
> > thanks

>
> -----------------------------------------------------------
> Did you see the rand() function?
> So how about something like this
> randomArray = minValue + (maxValue-MinValue)*rand(rows, columns);



Is this code avoiding duplicates ?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.