If x is a vector, compute the median value of the elements of x. If the elements of x are sorted, the median is defined as If x is a matrix, compute the median value for each column and return them in a row vector. If the optional dim argument is given, operate along this dimension.