Smoothing Data With a Median Smoother |
medsmooth(vy, n) Returns a smoothed vector by replacing each value in vy with the median of the n points centered on that value. The window width, n, is contracted near the ends of the vector.
n is an odd integer less than the number of elements in vy.
This function is the most robust of the smoothing functions since it is least likely to be affected by spurious data points. It does, however, tend to rub out sharp features in the data. You may wish to compare this method with Gaussian Kernel smoothing or Localized Least-squares smoothing. The loess polynomial regression technique is also an effective smoother.