timeseries

Methods

Method Reference: timeseries.gettsatevent

timeseries: ts2 = gettsatevent (ts, event)

timeseries: ts2 = gettsatevent (ts, event, n)

Return a series of the samples at the event.

ts2 = gettsatevent (ts, event) returns the series ts holding only the samples whose time is at 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 = gettsatevent (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.gettsafteratevent, timeseries.gettsafterevent, timeseries.gettsbetweenevents, timeseries.addevent

Source Code: timeseries