Random numbers from a user defined distribution
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!
Cite As
Adam Nieslony (2024). Random numbers from a user defined distribution (https://www.mathworks.com/matlabcentral/fileexchange/26003-random-numbers-from-a-user-defined-distribution), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: randpdf2(x, y, p, m)
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |