MATLAB: Appropriate measurement for handling error outliers

outlier

Dear all,
As you may see on the diagram, i have a data with outliers.
Accodring to the licterature that i have gone through, two possibilities are adjusting the data points to their correct values or remove such observations from the data.
I have tried to adjust the outliers usings standard deviation, z-factors (value of 3), and calculating the mean at the position of outliers using previous and next value.
Could you advise me a better way to deal with outliers?

Best Answer

Use the functions and tasks listed on this documentation page for cleaning outliers from your data.