%% timeseries from Event
% Create a timeseries object with an event occurring at time sample 2.

tsin = timeseries((1:5)');
tsevent = tsdata.event('MyEvent',2);
tsin = addevent(tsin,tsevent);
tsin.Events

% Create a new timeseries object that contains the data from the event sample of tsin and all samples after the event.

tsout = gettsafteratevent(tsin,'MyEvent');
tsout.Time

% Copyright 2012 The MathWorks, Inc.