To calculate the probability of a lognormal distribution in MATLAB, you can use the logncdf
function. The logncdf
function returns the cumulative distribution function (CDF) of the lognormal distribution for a given set of parameters.
main.m419 chars16 lines
In the above code, we first define the parameters of the lognormal distribution (mu
and sigma
). We then define a range of values x
for which we want to calculate the probability of the lognormal distribution. We use the logncdf
function to calculate the cumulative distribution function (CDF) of the lognormal distribution for each value of x
. Finally, we plot the probability distribution function (PDF) using the plot
function.
gistlibby LogSnag