gettsafterevent
Part of a timeseries strictly after an event.
Category: Language Fundamentals > Data Types
Syntax
tsout = gettsafterevent(ts, event)
Returns the samples with time later than the event.
Description
Events are added with addevent. The result is a new timeseries; its Time and Data hold the selected samples. A sample that falls exactly on the event time is excluded; use gettsafteratevent to keep it.
Input arguments
tstimeserieswith at least one event.event- Event name as text, or the event index.
Output arguments
tsouttimeserieswith the selected samples.
Examples
Samples after an event
ts = timeseries((10:10:50)', (0:4)');
ts = addevent(ts, 'start', 1.5);
ts = addevent(ts, 'stop', 3.5);
r = gettsafterevent(ts, 'start');
disp(r.Time')
disp(r.Data')
Output
2 3 4
30 40 50
Event on a sample
ts = timeseries((10:10:50)', (0:4)');
ts = addevent(ts, 'k', 2);
r = gettsafterevent(ts, 'k');
disp(r.Time')
Output
3 4
The sample at time 2 is not included.
See also
gettsafteratevent gettsbeforeevent gettsatevent gettsbetweenevents addevent