mean
Mean or average
M = mean(A)
- When
A
is a scalar,M
is equal toA
. - When
A
is a vector,M
is equal to the mean of elements ofA
. - When
A
is a matrix or a multidimensional array, an element ofM
is equal to the mean of elements of the corresponding vector ofA
along its first non-singleton dimension.
M = mean(A, k)
- This is the same as the previous cases, except that each element of
M
corresponds to a vector ofA
along itsk
-th dimension.
Note
If a vector contains NaN
, the mean of its elements given by mean
will be NaN
.