%% Interpolate Outliers with Sample Points
% Create a vector of data containing an outlier. Use linear interpolation to fill the outlier value relative to a time vector corresponding to the data. Plot the original data and the interpolated data.

A = [60 59 49 49 58 1000 61 57 48 62];
t = datetime(2017,1,1,0,0,0) + hours(0:9);
B = filloutliers(A,'linear','SamplePoints',t);
plot(t,A,t,B,'o')
legend('Original Data','Interpolated Data')

%
% Copyright 2012 The MathWorks, Inc.