View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Remove Outliers

4.7 | 3 ratings Rate this file 27 Downloads (last 30 days) File Size: 1.96 KB File ID: #24885 Version: 1.0

Remove Outliers


Vince Petaccio (view profile)


Uses the Thompson Tau technique to remove outliers from a vector containing statistical data.

| Watch this File

File Information

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.


This file inspired Regression Outliers and Remove Outliers.

MATLAB release MATLAB 7.8 (R2009a)
Other requirements MATLAB. :o]
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
13 Mar 2013 Luke Plausin

Luke Plausin (view profile)

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

07 Aug 2012 Vince Petaccio

Vince Petaccio (view profile)

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.

Comment only
05 Jun 2012 M Sohrabinia

M Sohrabinia (view profile)

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

23 Jan 2012 Yang Zhao

Contact us