Function median

Compute the median of a matrix or a list with values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned. Supported types of values are: Number, BigNumber, Unit

In case of a (multi dimensional) array or matrix, the median of all elements will be calculated.


median(a, b, c, ...)


Parameter Type Description
args ... * A single matrix or or multiple scalar values


Type Description
* The median


median(5, 2, 7);        // returns 5
median([3, -1, 5, 7]);  // returns 4

See also

mean, min, max, sum, prod, std, var