# 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 is
greater than 1.

If

`A`

is a vector, then`mean(A)`

returns the mean of the elements.If

`A`

is a matrix, then`mean(A)`

returns a row vector containing the mean of each column.If

`A`

is a multidimensional array, then`mean(A)`

operates along the first array dimension whose size is greater than 1, treating the elements as vectors. The size of`M`

in this dimension becomes`1`

, while the sizes of all other dimensions remain the same as in`A`

.If

`A`

is a table or timetable, then`mean(A)`

returns a one-row table containing the mean of each variable.*(since R2023a)*

`M = mean(___,`

returns the mean
with a specified data type for any of the previous syntaxes.
`outtype`

)`outtype`

can be `"default"`

,
`"double"`

, or `"native"`

.

`M = mean(___,`

specifies
whether to include or omit missing values in `missingflag`

)`A`

. For example,
`mean(A,"omitmissing")`

ignores all missing values when
computing the mean. By default, `mean`

includes missing
values.

## Examples

## Input Arguments

## More About

## Extended Capabilities

## Version History

**Introduced before R2006a**