timeseries

Methods

Method Reference: timeseries.gettsbeforeevent

timeseries: ts2 = gettsbeforeevent (ts, event)

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

Return a series of the samples before the event.

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

Source Code: timeseries