%% Determine Outliers with Mean
% Create a vector containing an outlier, and define outliers as points outside three standard deviations from the mean. Replace the outlier with the nearest element that is not an outlier, and plot the original data and the interpolated data.

A = [57 59 60 100 59 58 57 58 300 61 62 60 62 58 57];
B = filloutliers(A,'nearest','mean');
plot(1:15,A,1:15,B,'o')
legend('Original Data','Interpolated Data')

%
% Copyright 2012 The MathWorks, Inc.