Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Random number for triangular distribution
Date: Sat, 29 Sep 2012 07:01:13 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 10
Message-ID: <k466bp$nfi$1@newscl01ah.mathworks.com>
References: <k43g98$ksh$1@newscl01ah.mathworks.com> <k43h3f$njc$1@newscl01ah.mathworks.com> <k43hpv$plh$1@newscl01ah.mathworks.com> <k463ad$dm5$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1348902073 24050 172.30.248.38 (29 Sep 2012 07:01:13 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 29 Sep 2012 07:01:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:779526

"Roger Stafford" wrote in message <k463ad$dm5$1@newscl01ah.mathworks.com>...
> 
>  n = 100000;
>  a = 5; b = 10; c = 7;
>  r = c+sqrt(rand(n,1)).*(a-c+rand(n,1)*(b-a)); 
> 

Brilliant!

Bruno