Documentation |
Average or mean value of array
M = mean(A) returns the mean value along the first array dimension of A whose size does not equal 1.
If A is a vector, then mean(A) returns the mean of the elements.
If A is a nonempty, nonvector matrix, then mean(A) treats the columns of A as vectors and returns a row vector whose elements are the mean of each column.
If A is an empty 0-by-0 matrix, then mean(A) returns NaN.
If A is a multidimensional array, then mean(A) treats the values along the first array dimension whose size does not equal 1 as vectors and returns an array of row vectors. The size of this dimension becomes 1 while the sizes of all other dimensions remain the same.