Remove outliesrs (matlab2016b)

3 次查看(过去 30 天)
Christina Geo
Christina Geo 2021-9-25
Hello,
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)));
index=find(isOutlier==0);
A=A(index);

回答(1 个)

Star Strider
Star Strider 2021-9-25
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.)
.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by