To calculate the probability of a normal distribution in MATLAB, you can use the normcdf
function, which stands for "normal cumulative distribution function". This function takes in three arguments: the value you want to calculate the probability of, the mean of the distribution, and the standard deviation of the distribution. The output of normcdf
represents the area under the curve of the normal distribution to the left of the input value.
Here's an example:
main.m323 chars11 lines
This will output:
main.m58 chars2 lines
This means that there's an 84.13% chance that a randomly drawn sample from this normal distribution will be less than 1.
gistlibby LogSnag