Main Content

expstat

Exponential mean and variance

Description

m = expstat(mu) returns the mean for the exponential distribution with the mean parameter mu.

[m,v] = expstat(mu) also returns the variance for the distribution.

example

Examples

collapse all

Compute the mean and variance of an exponential distribution with the mean parameter mu.

mu = 3;
[mean,variance] = expstat(mu)
mean = 
3
variance = 
9

Input Arguments

collapse all

Mean of the exponential distribution, specified as a positive scalar value or an array of positive scalar values.

Data Types: single | double

Output Arguments

collapse all

Mean for the exponential distribution, returned as a numeric scalar or an array of numeric scalars. m is the same size as mu. Each element in m is the mean of the exponential distribution specified by the corresponding element in mu.

The mean of the exponential distribution is mu.

Variance for the exponential distribution, returned as a numeric scalar or an array of numeric scalars. v is the same size as mu. Each element in v is the variance of the exponential distribution specified by the corresponding element in mu.

The variance of the exponential distribution is mu squared.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a