Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help with Random Variable Generation
Date: Fri, 16 Jan 2009 20:49:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <gkqrru$fht$1@fred.mathworks.com>
References: <gkqh11$osq$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1232138942 15933 172.30.248.37 (16 Jan 2009 20:49:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Jan 2009 20:49:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:512132


"Omega69 Omega69" <Omega69@gmail.com> wrote in message <gkqh11$osq$1@fred.mathworks.com>...
> I'm trying to generate a random variable which probability density function is:
> f(x)=1-|x|,    -1<=x<=1
> ......

 x = sum(rand(1,2))-1;

Roger Stafford