Skip to Main Content Skip to Search
Product Documentation

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.

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.

See Also

gettsafterevent | gettsbeforeevent | tsdata.event

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS