Thread Subject: how to generate a random number ?

Subject: how to generate a random number ?

From: Priom Rahman

Date: 31 Jul, 2010 02:05:04

Message: 1 of 4

Hi guys, just wondering if someone could help me work out the code to generate a random number between 0 and 1 ? with any number having an equal likelyhood of being generated ?

Subject: how to generate a random number ?

From: Ross W

Date: 31 Jul, 2010 02:37:03

Message: 2 of 4

"Priom Rahman" <z3188254@unsw.edu.au> wrote in message <i300cg$960$1@fred.mathworks.com>...
> Hi guys, just wondering if someone could help me work out the code to generate a random number between 0 and 1 ? with any number having an equal likelyhood of being generated ?

Hi

There's no need to write code. Matlab has a built-in function.

help rand

If you used the search function in Matlab's help, you could find this too.

Ross

Subject: how to generate a random number ?

From: Priom Rahman

Date: 31 Jul, 2010 02:55:04

Message: 3 of 4

Thanks I searched for random numbers and i didnt get this link :)
But i'm on board now!!

Subject: how to generate a random number ?

From: Matt Fig

Date: 31 Jul, 2010 04:43:04

Message: 4 of 4

Just for future reference, you should be familiar with MATLAB's help. For instance, try this from the command line:

>> docsearch('random numbers')

On my installation, both RAND and RANDN are in the top 5 returned results.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
random numbers Priom Rahman 30 Jul, 2010 22:09:04
rssFeed for this Thread

Contact us at files@mathworks.com