In Matlab, you can calculate the cumulative distribution function (CDF) of a random variable using the cdf
function.
Syntax:
main.m15 chars2 lines
where pd
is a probability distribution object that represents the distribution of the random variable and x
is the value at which to evaluate the CDF.
Here's an example of how to calculate the CDF of a normal distribution using the cdf
function:
main.m223 chars10 lines
This will output:
main.m30 chars2 lines
This means that the probability that a random variable from this normal distribution is less than or equal to 0.5 is approximately 0.6915.
gistlibby LogSnag