Path: news.mathworks.com!not-for-mail
From: "Tom Lane" <tlane@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Random matrix/normal distribution
Date: Wed, 30 Sep 2009 10:32:19 -0400
Organization: The MathWorks, Inc
Lines: 17
Message-ID: <h9vq5j$sno$1@fred.mathworks.com>
References: <h9tpd6$bh9$1@fred.mathworks.com>
Reply-To: "Tom Lane" <tlane@mathworks.com>
NNTP-Posting-Host: lanet.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1254321139 29432 172.31.57.151 (30 Sep 2009 14:32:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Sep 2009 14:32:19 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:573978


> I'm trying to generate random matrices whose entries are from the normal 
> distribution.
>
> Something like this:
>
> (1/(sqrt(2*pi)))*exp(-(1+99*rand(5))^2/2)
>
> Isn't going to work because squaring a matrix doesn't square each entry. 
> How can I correct this or am I going about this the wrong way.

Michael, if you square the matrix, this will give you values of the normal 
density function evaluated at random points. I encourage you to try the 
advice from dbp instead of squaring the matrix in this formula.

-- Tom