tsdata.event

Event marker attached to a time series at a given time.

Category: Language Fundamentals > Data Types

Syntax

e = tsdata.event(name, time)

Creates an event called name at time.

Description

Events mark points of interest in a series, such as the moment a threshold is crossed. After creating one, attach it to a timeseries with addevent; the time of every event is then available from the series.

The event object is a plain container: it holds the name and time you gave it, and the other properties can be set by assignment.

Input arguments

name
Name of the event, as text.
time
Time of the event, in the units of the series.

Output arguments

e
Event object with properties Name, Time, Units, StartDate and EventData.

Example

Create an event

e = tsdata.event('peak', 2);
e.Name
e.Time
e.Units
Output
ans = 'peak'
ans = 2
ans = 'seconds'

See also

timeseries addevent tscollection gettsafteratevent