%% Outlier Thresholds
% Find the outlier in a vector of data, and replace it using the 'clip' method. Plot the original data, the filled data, and the thresholds and center value determined by the detection method. 'clip' replaces the outlier with the upper threshold value.

x = 1:10;
A = [60 59 49 49 58 100 61 57 48 58];
[B,TF,lower,upper,center] = filloutliers(A,'clip');
plot(x,A,x,B,'o',x,lower*ones(1,10),x,upper*ones(1,10),x,center*ones(1,10))
legend('Original Data','Filled Data','Lower Threshold','Upper Threshold','Center Value')

%
% Copyright 2012 The MathWorks, Inc.