Main Content

delevent

Remove event from timeseries

Description

example

tsout = delevent(tsin,eventname) removes a tsdata.event object from the tsin.Events property of a timeseries object tsin. The eventname argument can be a character vector containing the name of a single event or a cell array containing a collection of event names.

tsout = delevent(tsin,eventname,n) removes the nth tsdata.event object from the tsin.Events property for the event named eventname.

Examples

collapse all

Create a timeseries and an event, and add the event to the timeseries.

tsin = timeseries((1:5)');
tsevent = tsdata.event('MyEvent',1);
tsin = addevent(tsin,tsevent);
tsin.Events
    EventData: []
         Name: 'MyEvent'
         Time: 1
        Units: 'seconds'
    StartDate: ''

Remove the event named MyEvent.

tsout = delevent(tsin,'MyEvent');
tsout.Events
ans =

    1x0 empty handle

Input Arguments

collapse all

Input timeseries, specified as a scalar.

Data Types: timeseries

Event name, specified as a character vector containing the name of a tsdata.event object or a cell array containing multiple event names.

Data Types: char | cell

Event number, specified as a scalar integer corresponding to the nth tsdata.event of a timeseries object.

Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Version History

Introduced before R2006a