%% Delete Sample
% Delete a sample in a timeseries object.
% Create a timeseries and display its time samples and corresponding data.

tsin = timeseries((0:10:50)',(0:5)');
tsin.Time
tsin.Data

% Delete the last sample by referencing its index, which is 6.

tsout = delsample(tsin,'Index',6);
tsout.Time

% Alternatively, you can specify the time value 5 to remove the last sample of tsin.

tsout = delsample(tsin,'Value',5);

% Copyright 2012 The MathWorks, Inc.