timeseries.gettsafterevent
timeseries: ts2 = gettsafterevent (ts, event)
timeseries: ts2 = gettsafterevent (ts, event, n)
Return a series of the samples after the event.
ts2 = gettsafterevent (ts, event) returns the
series ts holding only the samples whose time is strictly after the
time of event, compared exactly. event is the name of an
event of ts, a character vector or a string scalar matched in case,
which selects the first event of that name; or a tsdata.event
object, which need not belong to ts.
ts2 = gettsafterevent (ts, event, n) uses
the nth event named event, counting only the events of that
name in the order they are held. For a tsdata.event object
n can only be 1. A name no event has, or an n beyond the
events of that name, is refused; MATLAB then returns an empty series. So
is a dated event on a series with no start date, which MATLAB reads as
time 0.
See also: timeseries.gettsbeforeevent, timeseries.gettsbeforeatevent, timeseries.gettsatevent, timeseries.gettsafteratevent, timeseries.gettsbetweenevents, timeseries.addevent
Source Code: timeseries
The six event queries cut a series at an event: before it, after it, at it, or between two. The at forms include the event's own time.
ts = timeseries ((10:10:60)', 0:5); ts = addevent (ts, 'switch', 3); s = gettsafterevent (ts, 'switch'); [s.Time, s.Data]
ans =
4 50
5 60
s = gettsafteratevent (ts, 'switch'); [s.Time, s.Data]
ans =
3 40
4 50
5 60