do you mean:Code:k=mymedian(sort(p))
you may also be interested in this if you dont want to use the standard matlab "sort" function.
http://www.mathhelpforum.com/math-he...or-matlab.html
Regards Elbarto
This will return a sorted matrix for "w". The orginal code uses the length function so not all values will be included will they?
@OP, when finding the median of the matrix, do you only want the median of the entire matrix or the median of each column like matlab calculates?
Regards Elbarto