Clear Filters
Clear Filters

How to change the random distribution to Weibull distribution?

3 views (last 30 days)
My supervisor wants me to use the scripts he provided and change the random distribution of the cracks to Weibull or Gaussian distribution. I have tried to fit in the method described in mathworks for Weibull distribution but I do not see any changes on the results since I was just inputing the codes. I have attached the scripts for the calculation of crack density where the cracks are distributed randomly.

Answers (1)

Omanshu Thapliyal
Omanshu Thapliyal on 27 Mar 2017
It seems like you want to change your random variable 'r' from uniform to Gaussian or Weibull. Currently, random variable 'r' is distributed uniformly in your code as
r = rand(L,L)
because the function rand by default returns uniform random variables in the open interval (0,1).
You might want to use normrnd or wblrnd to get Gaussian or Weibull random variables instead. You could do so by calling
r = normrnd(mu, sigma, L, L)
r = wblrnd(a, b, L, L)
where mu, sigma, a, and b represent the standard distribution parameters as in the documentation.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!