Path: news.mathworks.com!not-for-mail
From: "Kirk" <kwythers.nospam@umn.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: generate long random vector by repeating 12 means and stds
Date: Thu, 15 Jan 2009 16:34:04 +0000 (UTC)
Organization: University of Minnesota
Lines: 13
Message-ID: <gknohs$h5r$1@fred.mathworks.com>
References: <gknl6u$p5t$1@fred.mathworks.com> <gknn6m$esn$1@fred.mathworks.com>
Reply-To: "Kirk" <kwythers.nospam@umn.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232037244 17595 172.30.248.38 (15 Jan 2009 16:34:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 15 Jan 2009 16:34:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1161409
Xref: news.mathworks.com comp.soft-sys.matlab:511816

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message 
> > 
> > Should this be done in a loop? or is there a more elegant Matlab-ish approach? 
> > 
>   You can do it with one call to 'normrnd' if you do a 'repmat' on 'y_mu' and 'y_sigma'.
> 
>  y_rand = normrnd(repmat(y_mu,1,100),repmat(y_sigma,1,100));
> 
>   Note: This advice is based on reading the documentation.  I haven't actually used 'normrnd' myself.
> 
> Roger Stafford

That's a nice solution. Thank you.