From: TideMan <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help with randn function
Date: Sun, 22 Jan 2012 16:52:09 -0800 (PST)
Lines: 19
Message-ID: <>
References: <jfhofu$l8u$> <jfhqbi$sab$>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1327279929 27153 (23 Jan 2012 00:52:09 GMT)
NNTP-Posting-Date: Mon, 23 Jan 2012 00:52:09 +0000 (UTC)
Injection-Info:; posting-host=; posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HUALESRCNK
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe)
Xref: comp.soft-sys.matlab:755390

On Jan 23, 10:51 am, "Francesco " <> wrote:
> Another way you have is to call normrnd in this way:
> normrnd(-1,1,1,20)
> I hope this helps.

No, it doesn't help, because it is wrong.
The first 2 arguments are the mean and standard deviation.

A possible way of getting the distribution between -1 and 1 is to use
the universal threshold of Donoho & Johnstone:
which gives the expected maximum of randn for n numbers.
Note that it's only the "expected" maximum, so this means lambda could
be exceeded.
But scaling the numbers by lambda will, on average, ensure they are
between -1 and 1.