FUNCTION REFERENCE

mean

Average value.

Average value.

Syntax

mean(A)

Returns the mean of each column, or one value for a row vector.

Example

mean([1 2 3 4])   % 2.5

Example

mean(reshape(1:8,2,2,2),'all')   % 4.5000

Differences from MATLAB: No 'all', type or NaN options for 2-D input. The mean of [] is NaN. Complex input divides the narrowed complex sum by the count, as MATLAB does. N-D arrays (part 2): dim, vecdim, 'all', 'omitnan'/'includenan' and 'double'/'native'/'default'; an integer mean is double unless 'native'.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.