Remove outliesrs (matlab2016b)

1 view (last 30 days)
Christina Geo
Christina Geo on 25 Sep 2021
Answered: Star Strider on 25 Sep 2021
I would like to find and remove outliers from a matrix but I use matlab2016b so i don't have rmoutliers. My matrix is A(1469,8) and i want to find outliers and remove them by column. I tried to build the equation. I tried the code below but there are 2 problems
1)The result of isOutlier(1469,8) is not right because are all zeros so I think that doesn't do the math by column.
2) The result of index is a double (11752,1) insted of a matrix with 8 columns
Any idea?
isOutlier = abs(A) > -3/(sqrt(2)*erfcinv(3/2))*median(abs(A - median(A)));

Answers (1)

Star Strider
Star Strider on 25 Sep 2021
If you have the Signal Processing Toolbox, the hampel function (introduced in R2015b) could do what you want. Check your own R2016b documentation for it, since it could have changed in the last 5 years, and the R2021b documentation I linked to may not strictly apply.)
(I added the Products and Release information in their respective windows. Expand the Products entries if necessary.)


Find more on Matrices and Arrays in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!