timeseries

Methods

Method Reference: timeseries.gettsbeforeatevent

timeseries: ts2 = gettsbeforeatevent (ts, event)

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

Return a series of the samples before and at the event.

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

Source Code: timeseries