mean
Average or mean value of array
Syntax
Description
M = mean(
returns
the mean of the elements
of A
)A
along the first array dimension whose size
does not equal 1.
If
A
is a vector, thenmean(A)
returns the mean of the elements.If
A
is a matrix, thenmean(A)
returns a row vector containing the mean of each column.If
A
is a multidimensional array, thenmean(A)
operates along the first array dimension whose size does not equal 1, treating the elements as vectors. This size of this dimension becomes1
while the sizes of all other dimensions remain the same asA
.
M = mean(
computes the mean over all elements of A
,'all'
)A
. This syntax is valid
for MATLAB® versions R2018b and later.
M = mean(___,
returns
the mean with a specified data type, using any of the input arguments
in the previous syntaxes. outtype
)outtype
can be 'default'
, 'double'
,
or 'native'
.
Examples
Input Arguments
More About
Extended Capabilities
Version History
Introduced before R2006a