gettsbetweenevents

New timeseries object with samples occurring between events

Syntax

ts1 = gettsbetweenevents(ts,event1,event2)
ts1 = gettsbetweenevents(ts,event1,event2,n1,n2)

Description

ts1 = gettsbetweenevents(ts,event1,event2) returns a new timeseries object ts1 with samples occurring between events in ts, where event1 and event2 can be either a tsdata.event object or a string. When event1 and event2 are tsdata.event objects, the time defined by the events is used. When event1 and event2 are strings, the first tsdata.event object in the Events property of ts that matches the event names specifies the time.

ts1 = gettsbetweenevents(ts,event1,event2,n1,n2) returns a new timeseries object ts1 with samples occurring between events in ts, where n1 and n2 are the nth occurrences of the events with matching event names.

More About

expand all

Tips

When the timeseries object ts contains date strings and event uses numeric time, the time selected by the event is treated as a date that is calculated relative to the StartDate property in ts.TimeInfo.

When ts uses numeric time and event uses calendar dates, the time selected by the event is treated as a numeric value that is not associated with a calendar date.

Was this topic helpful?