delevent
Removes an event from a timeseries object.
Category: Language Fundamentals > Data Types
Syntax
ts = delevent(ts, event)
Removes the event with the given name, or the event object.
Description
Events are named markers placed at times of a time series, created with addevent. They are stored in the Events property. delevent deletes one of them by name; the time and data samples are untouched.
Input arguments
ts- timeseries object.
event- Name of the event (text), or a
tsdata.eventobject.
Output arguments
ts- The timeseries without the event.
Example
Add and remove an event
ts = timeseries([1 2 3 4]', [0 1 2 3]');
ts = addevent(ts, 'e', 1);
n1 = numel(ts.Events)
ts = delevent(ts, 'e');
n2 = numel(ts.Events)
Output
n1 = 1
n2 = 0