Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: random number in [0,1]

Subject: random number in [0,1]

From: Dave Krebs

Date: 06 Dec, 2007 23:25:14

Message: 1 of 5

How can I generate a normally-distributed random number in
[0,1] in Matlab?

Thanks

Subject: Re: random number in [0,1]

From: Roger Stafford

Date: 07 Dec, 2007 00:46:56

Message: 2 of 5

"Dave Krebs" <djk37@mathworks.com> wrote in message <fja0cp$g74
$1@fred.mathworks.com>...
> How can I generate a normally-distributed random number in
> [0,1] in Matlab?
>
> Thanks
---------
  We need more explanation about your problem, Dave. The difficulty is that a
normally distributed random variable has values extending over the full range of
numbers, (-inf,+inf), no matter what mean value and standard deviation it has.
There is no way to squeeze it into the finite range [0,1] except by rejecting some
of its values, and then it would no longer have a valid normal distribution.

Roger Stafford

Subject: Re: random number in [0,1]

From: Yumnam Kirani Singh

Date: 07 Dec, 2007 04:37:03

Message: 3 of 5

See the randn command.

Subject: Re: random number in [0,1]

From: James Tursa

Date: 07 Dec, 2007 07:06:20

Message: 4 of 5

On Thu, 6 Dec 2007 23:25:14 +0000 (UTC), "Dave Krebs"
<djk37@mathworks.com> wrote:

>How can I generate a normally-distributed random number in
>[0,1] in Matlab?
>
>Thanks

Do you mean Normal(0,1), a notation sometimes used for a standard
normal distribution with 0 mean and standard devaition = 1? If so, do
like a previous poster suggested and look up randn.

James Tursa

Subject: Re: random number in [0,1]

From: Bruno Luong

Date: 07 Dec, 2007 07:27:50

Message: 5 of 5

"Dave Krebs" <djk37@mathworks.com> wrote in message
<fja0cp$g74$1@fred.mathworks.com>...
> How can I generate a normally-distributed random number in
> [0,1] in Matlab?
>

You cannot, such normal distribution does not exist.

Bruno

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 Dave Krebs 06 Dec, 2007 18:30:07
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics