Generate a random number with specific probability density function
1 view (last 30 days)
Show older comments
ricard molins on 7 Apr 2015
Commented: Torsten on 8 Apr 2015
I'm trying to generate a random number with a given PDF. I have the PDF stored as :
- X: with the possible values
- Y: with the density
plot(X,Y) displays the PDF
I've tried to use fitdist and makedist but I'm not able to convert it into a PDF object or anything usable.
Thanks you in advance
Sean de Wolski on 7 Apr 2015
Torsten on 8 Apr 2015
Given x, interpolate the density y(x) from your data vector Y.
This will give you a Kind of "function" y(x).
Find more on Triangular Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!