%% Subset of timeseries
% Create a timeseries object tsout that is a subset of the samples in the timeseries object tsin.

tsin = timeseries([10 20 30 40 50]',[1 2 3 4 5]);
tsout = getsamples(tsin, tsin.time([2 3]));
tsout.Data

% Copyright 2012 The MathWorks, Inc.