File Exchange

image thumbnail

Remove Outliers

version (1.96 KB) by N/A
Uses the Thompson Tau technique to remove outliers from a vector containing statistical data.


Updated 30 Jul 2009

View License

For vectors, REMOVEOUTLIERS(datain) removes the elements in datain that are considered outliers as defined by the Thompson Tau method. This applies to any data vector greater than three elements in length, with no upper limit (other than that of the machine running the script). Additionally, the output vector is sorted in ascending order.

Cite As

N/A (2021). Remove Outliers (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

pradeep kumar

Can i get the out data without sorting?

qi li


Luke Plausin

Worked straight away, no fuss, no effort. Thanks!


Thanks for your comments, guys! I made this file some time ago and it certainly could use some updating.

I appreciate your input regarding tracing the actions of the function and NaN-handling, Mr. Sohrabinia. I'll update this function soon with these comments in mind.

M Sohrabinia

Thanks for the code Vince: just a few points that I came across using your code: the code does not specify which element was an outlier and leaves no trace behind after removal of the outlier. This creates a problem when two variables are meant to be compared. Filling the outlier by NaN could be one idea. Also, your code does not work if there is any NaNs in the given vector.
Good luck

Yang Zhao

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: Regression Outliers, Remove outliers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!