median
Median value.
Syntax
Section titled “Syntax”M = median(A)M = median(A, dim)Description
Section titled “Description”Returns the median (50th percentile) of A. For even-length vectors, returns the average of the two middle values. Operates along the first non-singleton dimension by default; pass dim to override.
Examples
Section titled “Examples”median([1 2 3 4]) % 2.5median([1 5 100]) % 5 (robust to outliers)See also
Section titled “See also”Also categorized under: Range Functions / Math.