I know the probability density function (PDF) expression of random variable r as 2r/R^2 where 0<=r<=R. Then, its CDF is r^2/R^2.
Can someone help me to generate random variable r in MATLAB following above distribution?
I know the probability density function (PDF) expression of random variable r as 2r/R^2 where 0<=r<=R. Then, its CDF is r^2/R^2.
Can someone help me to generate random variable r in MATLAB following above distribution?
Copyright © 2021 Jogjafile Inc.
https://blogs.sas.com/content/iml/2013/07/22/the-inverse-cdf-method.html
I use the same variables as they use
f(x) = 2x/R^2
F(x) = x^2/R^2
solving for x in the equation F(x) = u
u*R^2 = x^2
x = sqrt(u * R^2) v -sqrt(u * R^2)
in Matlab: