tsdata.event
datatypes: tsdata.event
An event of a timeseries.
A tsdata.event object marks a named instant, with any data the user
attaches to it. The Events property of a timeseries holds
an array of them. An event carries its own time, in its own units and
optionally from its own start date, so it keeps its instant when the
series’ time vector changes.
Source Code: tsdata.event
The tsdata.event class contains the following properties:
One of the units a timeseries time vector takes, or ''.
MATLAB accepts any value here.
The tsdata.event class offers the following public methods:
tsdata.event: e = tsdata.event ()
tsdata.event: e = tsdata.event (name)
tsdata.event: e = tsdata.event (name, time)
e = tsdata.event (name) returns an event named
name, a character vector or a string scalar, at Time 0
with no Units. With no argument the name is ''.
e = tsdata.event (name, time) places it at
time. A real scalar is a relative time in seconds. A date, as
text or as a scalar datetime, is an absolute time: the event is
then at Time 0 in 'days' from a StartDate of
that date, stored as 'dd-mmm-yyyy HH:MM:SS', with milliseconds
as '.FFF' when the seconds are not whole.
MATLAB ignores a third argument and refuses a datetime.
See also: timeseries
tsdata.event: S = get (e)
tsdata.event: value = get (e, name)
tsdata.event: values = get (e, names)
S = get (e) returns a structure of every
property of e. value = get (e,
name) returns the property name, a character vector or a
string scalar matched in any case, and values = get
(e, names) a row cell array of the properties named in
the cell array names. For an array, one name gives a cell
array of its size, and no name, or several, a cell array with a row
per object and a column per property.
MATLAB refuses an output argument to set on an event and, given
an array of events and one name, returns the first event’s value only;
here set returns the modified events as on any other class, and
get returns one value per event.
See also: tsdata.event.set, timeseries.get
tsdata.event: set (e, name, value, …)
tsdata.event: e2 = set (e, name, value, …)
tsdata.event: S = set (e)
set (e, name, value, …) sets each
property name, matched in any case, to its value, in the
order given, in the variable e of the caller, which must
therefore be a variable. Metadata held by a timeseries is set
with dot assignment instead, as
ts.TimeInfo.Units = 'days'.
e2 = set (e, name, value, …)
returns the modified object and leaves e as it was.
S = set (e) returns what get (e)
does.
See also: tsdata.event.get, timeseries.set