Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!r29g2000yqj.googlegroups.com!not-for-mail
From: ImageAnalyst <imageanalyst@mailinator.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to generate random number given density function?
Date: Sat, 27 Nov 2010 06:39:33 -0800 (PST)
Organization: http://groups.google.com
Lines: 4
Message-ID: <12e13f7e-4c9c-40c2-b1e8-4b70f8cb1615@r29g2000yqj.googlegroups.com>
References: <icqqh0$19p$1@fred.mathworks.com>
NNTP-Posting-Host: 184.57.134.178
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1290868773 6425 127.0.0.1 (27 Nov 2010 14:39:33 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 27 Nov 2010 14:39:33 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: r29g2000yqj.googlegroups.com; posting-host=184.57.134.178; posting-account=0rLUzAkAAABojYSRC64DkTbtiSCX77HH
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.12)
 Gecko/20101026 Firefox/3.6.12,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:690432

In short, you need to compute the cumulative distribution function and
then invert it and stick in the uniform distribution.  See #6 in this
thread where I do the process for a Ralyeigh distribution.
http://www.mathworks.com/matlabcentral/newsreader/view_thread/289740#772962