To calculate the probability of an exponential distribution in matlab, you can use the exppdf
, expcdf
, and expinv
functions.
exppdf(x, mu)
returns the probability density function of the exponential distribution with mean mu
at the values in x
.expcdf(x, mu)
returns the cumulative distribution function of the exponential distribution with mean mu
at the values in x
.expinv(p, mu)
returns the inverse of the cumulative distribution function of the exponential distribution with mean mu
for the probabilities in p
.Here is an example of how to calculate and plot the probability density function and cumulative distribution function of an exponential distribution with mean 2:
main.m363 chars25 lines
Output:
gistlibby LogSnag