gettsafteratevent
Part of a timeseries from an event onward, including the event time.
Category: Language Fundamentals > Data Types
Syntax
tsout = gettsafteratevent(ts, event)
Returns the samples at or after the event, named by event (or its index).
Description
Events are added with addevent. The result is a new timeseries; its Time and Data hold the selected samples. Samples whose time equals or exceeds the event time are kept. Compare gettsafterevent, which keeps only samples strictly later.
Input arguments
tstimeserieswith at least one event.event- Event name as text, or the event index.
Output arguments
tsouttimeserieswith the selected samples.
Example
Samples from an event on
ts = timeseries((10:10:50)', (0:4)');
ts = addevent(ts, 'start', 1.5);
ts = addevent(ts, 'stop', 3.5);
r = gettsafteratevent(ts, 'start');
disp(r.Time')
disp(r.Data')
Output
2 3 4
30 40 50
See also
gettsafterevent gettsbeforeatevent gettsatevent gettsbetweenevents addevent