Contents Previous Next Subchapters

Computing The Median of Each Column
Syntax colmedian(x)
See Also colrange , median , colmean , colmode , sort , psort

Description
Returns a row vector containing the median of each column of x, where x is an integer, real, or double-precision matrix. The return value has the same type and column dimension as x.

If x has an even number of rows, the average of the two central values is returned. If x is also an integer, the fractional part of this average is dropped.

Example
     x = {2, 3, 1}
     colmedian(x)
returns
     2