Skip to content

mean

Arithmetic mean.

M = mean(A)
M = mean(A, dim)
M = mean(A, flag)

Returns the arithmetic mean of A. With no second argument, averages along the first non-singleton dimension. With a numeric dim, averages along that dimension. The optional flag ('omitnan' / 'includenan') controls NaN handling — default is to skip NaN values.

mean([1 2 3 4 5]) % 3
mean([1 2; 3 4]) % [2 3] column means
mean([1 2; 3 4], 2) % [1.5; 3.5] row means
  • median — Median value.
  • std — Standard deviation.
  • var — Variance.
  • rms — Root mean square.
  • sum — Sum elements of an array.

Also categorized under: Range Functions / Math.