Documentation

mean

Mean of probability distribution

Syntax

m = mean(pd)

Description

example

m= mean(pd)returns the meanmof the probability distributionpd.

Examples

collapse all

Load the sample data. Create a vector containing the first column of students' exam grade data.

loadexamgradesx =成绩(:1);

Create a normal distribution object by fitting it to the data.

pd = fitdist(x,'Normal')
pd = NormalDistribution Normal distribution mu = 75.0083 [73.4321, 76.5846] sigma = 8.7202 [7.7391, 9.98843]

计算mean of the fitted distribution.

m = mean(pd)
m = 75.0083

The mean of the normal distribution is equal to the parametermu.

Create a Weibull probability distribution object.

pd = makedist('Weibull','a',5,'b',2)
pd = WeibullDistribution Weibull distribution A = 5 B = 2

计算mean of the distribution.

mean = mean(pd)
mean = 4.4311

Input Arguments

collapse all

Probability distribution, specified as a probability distribution object. Create a probability distribution object with specified parameter values usingmakedist. Alternatively, create a probability distribution object by fitting it to data usingfitdistor the Distribution Fitter app.

Output Arguments

collapse all

Mean of the probability distribution, returned as a scalar value.

Introduced before R2006a

Was this topic helpful?