Removing highest and lowest 5% of data as outliers using prctile
27 views (last 30 days)
Show older comments
Shervin Safineh
on 2 Nov 2020
Commented: Nicholas Omoding
on 11 Jul 2021
I have some numerical data imported from an Excel sheet in a column. I want to remove the highest 5% and the lowest 5% of these numbers as outliers using the prctile function. How can I do this?
Thanks in advance!
0 Comments
Accepted Answer
Jeff Miller
on 2 Nov 2020
% Data values are in X; X2 holds remaining values after outliers removed
Y = prctile(X,[5,95]);
X2 = X(X>Y(1) & X<Y(2)); % maybe you want >= and <=, depending on your definition of outlier
1 Comment
Nicholas Omoding
on 11 Jul 2021
I’ve surface damage depth (D) for 3D points (x, y, z). I’d like remove top and bottom 5% of the D values with their corresponding (x, y, z) from the matrix so that I can plot the remaining 90% of the points. Based on the attached sub set of the data, please kindly assist on the based way to achieve this.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!