5.0

5.0 | 2 ratings Rate this file 15 Downloads (last 30 days) File Size: 2.15 KB File ID: #26003
image thumbnail

Random numbers from a user defined distribution

by Adam Nieslony

 

02 Dec 2009

creturns the matrix of random numbers from user defined probability density distribution.

| Watch this File

File Information
Description

RANDPDF returns the matrix of random numbers from probability density distribution defined in p and px. p are the density (the y axis) and px are the value (the x axis) of the pdf. p and px must be of the same length. dim define the output matrix dimensions, for example dim=[100 3] define the 100x3 two dimensional matrix with 300 random numbers.

REMEMBER: This is not a really random number generator but only some kind of transformation of uniformly distributed pseudorandom numbers to desired pdf!

MATLAB release MATLAB 7.1.0 (R14SP3)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
02 Dec 2009 Jos (10584)

Nice, but see

http://www.mathworks.com/matlabcentral/fileexchange/8891

and

http://www.mathworks.com/matlabcentral/fileexchange/14469

for other implementations

05 Sep 2010 Eugene  
15 Dec 2011 Jean-Luc Dellis

I wanted to do it, you already did it... perfectly. TY.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
random numbers Adam Nieslony 02 Dec 2009 12:15:06
pdf Adam Nieslony 02 Dec 2009 12:15:06
statistics Adam Nieslony 02 Dec 2009 12:15:06

Contact us at files@mathworks.com