The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 <> wrote in message <>...
> On Nov 10, 5:04?pm, "Patrick Diviacco" <>
> 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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.