Generate Random Variables from PDF
Version 1.0.2 (1.2 KB) by
Ayad Al-Rumaithi
Generate random variables from probability density function (pdf) using inverse transform technique
Generate random variables from probability density function (pdf) using inverse transform technique .
function x=PDF2Rand(xPDF,yPDF,N)
Input
xPDF:x values of probability density function
yPDF:y values of probability density function
N:Number of samples of the random varible
output
x:Generated random variable
Cite As
Ayad Al-Rumaithi (2026). Generate Random Variables from PDF (https://www.mathworks.com/matlabcentral/fileexchange/71789-generate-random-variables-from-pdf), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2017b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Random Number Generation in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
