Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
27
Добавлен:
09.02.2015
Размер:
200.19 Кб
Скачать

Time Series events

<tsdata.event> - Construct an event object for a time series.

TSDATA.EVENT Construct event object for timeseries object.

E = TSDATA.EVENT(Name,Time) creates an event object with the specified

name that occurs at the time Time. Time can either be a real value or

a date string.

E = TSDATA.EVENT(Name,Time,'Datenum') uses 'Datenum' to indicate that

the Time value is a serial date number generated by the datenum function.

The Time value is converted to a date string after the event is

created.

Reference page in Help browser

doc tsdata.event

<timeseries/addevent> - Add events.

ADDEVENT Add event objects to a time series object.

ADDEVENT(TS,E) adds an array of tsdata.event objects E to the EVENTS

property of the time series TS.

ADDEVENT(TS,NAME,TIME) constructs one or more tsdata.event objects and

add them to the EVENTS property of the time series TS. NAME is a cell

array of event name strings. TIME is a cell array of event times.

Example

Create a time series object:

ts = timeseries(rand(5,4))

Create event objects called 'e1' and 'e2' where the event occurs at

time 3 and 4 respectively:

e1 = tsdata.event('e1',3)

e2 = tsdata.event('e2',4)

View the properties (EventData, Name, Time, Units, StartDate) of the

event object:

get(e1)

Add the event object to the time series object TS:

ts = addevent(ts,[e1 e2])

An alternative way to add events is

ts = addevent(ts,{'e1' 'e2'},{3 4})

See also timeseries/timeseries

<timeseries/delevent> - Remove events.

DELEVENT Remove event objects from a time series object.

TS = DELEVENT(TS, EVENT), where EVENT is an event name string, removes the corresponding tsdata.event object from TS.EVENTS property.

TS = DELEVENT(TS, EVENTS), where EVENTS is a cell array of event name

strings, removes tsdata.event objects from the TS.EVENTS property.

TS = DELEVENT(TS, EVENT, N) removes the Nth tsdata.event object, whose

name is EVENT, from the TS.EVENTS property.

Example

Create a time series:

ts=timeseries(rand(5,4))

Create an event object called 'test' where the event occurs at time 3:

e=tsdata.event('test',3)

Add the event object to time series TS:

ts = addevent(ts,e)

Remove the event object from time series TS:

ts = delevent(ts,'test')

See also timeseries/timeseries, timeseries/addevent

<timeseries/gettsafteratevent> - Extract samples occurring at or after a specified event.

GETTSAFTERATEVENT Return a new timeseries object with all the samples

occurring at or after a specified event.

GETTSAFTERATEVENT(TS, EVENT) where EVENT can be either a tsdata.event object or a string. If EVENT is a tsdata.event object, the time

defined by EVENT is used. If EVENT is a string, the first tsdata.event

object in the Events property of TS that matches the EVENT name is used

to specify the time.

GETTSAFTERATEVENT(TS, EVENT, N) where N is the Nth appearance of the matching EVENT name.

Note: If the time series TS contains date strings and EVENT uses

relative time, the time selected by the EVENT is treated as a date

(calculated relative to the StartDate property in the TS.TimeInfo

property). If TS uses relative time and EVENT uses dates, the time

selected by the EVENT is treated as a relative value.

See also timeseries/gettsafterevent, timeseries/gettsbeforeevent,

timeseries/gettsbetweenevents

<timeseries/gettsafterevent> - Extract samples occurring after a specified event.

GETTSAFTEREVENT Return a new timeseries object with all the samples

occurring after a specified event.

GETTSAFTEREVENT(TS, EVENT) where EVENT can be either a tsdata.event object or a string. If EVENT is a tsdata.event object, the time defined by EVENT is used. If EVENT is a string, the first tsdata.event object in the Events property of TS that matches the EVENT name is used to specify the time.

GETTSAFTEREVENT(TS, EVENT, N) where N is the Nth appearance of the

matching EVENT name.

Note: If the time series TS contains date strings and EVENT uses

relative time, the time selected by the EVENT is treated as a date

(calculated relative to the StartDate property in the TS.TimeInfo

property). If TS uses relative time and EVENT uses dates, the time

selected by the EVENT is treated as a relative value.

See also timeseries/gettsafteratevent, timeseries/gettsbeforeevent,

timeseries/gettsbetweenevents

<timeseries/gettsatevent> - Extract samples occurring at a specified event.

GETTSATEVENT Return a new timeseries object with all the samples

occurring at the time of the specified event.

GETTSATEVENT(TS, EVENT) where EVENT can be either a tsdata.event

object or a string. If EVENT is a tsdata.event object, the time

defined by EVENT is used. If EVENT is a string, the first tsdata.event

object in the Events property of TS that matches the EVENT name is used

to specify the time.

GETTSATEVENT(TS, EVENT, N) where N is the Nth appearance of the

matching EVENT name.

Note: If the time series TS contains date strings and EVENT uses

relative time, the time selected by the EVENT is treated as a date

(calculated relative to the StartDate property in the TS.TimeInfo

property). If TS uses relative time and EVENT uses dates, the time

selected by the EVENT is treated as a relative value.

See also timeseries/gettsafterevent, timeseries/gettsbeforeevent,

timeseries/gettsbetweenevents

<timeseries/gettsbeforeatevent> - Extract samples occurring at or before a specified event.

GETTSBEFOREATEVENT Return a new timeseries object with all the samples

occurring before or at a specified event.

GETTSBEFOREATEVENT(TS, EVENT) where EVENT can be either a tsdata.event object or a string. If EVENT is a tsdata.event object, the time

defined by EVENT is used. If EVENT is a string, the first tsdata.event

object in the Events property of TS that matches the EVENT name is used to specify the time.

GETTSBEFOREATEVENT(TS, EVENT, N) where N is the Nth appearance of the matching EVENT name.

Note: If the time series TS contains date strings and EVENT uses

relative time, the time selected by the EVENT is treated as a date

(calculated relative to the StartDate property in the TS.TimeInfo

property). If TS uses relative time and EVENT uses dates, the time

selected by the EVENT is treated as a relative value.

See also timeseries/gettsafterevent, timeseries/gettsbeforeevent,

timeseries/gettsbetweenevents

<timeseries/gettsbeforeevent> - Extract samples occurring before a specified event.

GETTSBEFOREEVENT Return a new timeseries object with all the samples

occurring before a specified event.

GETTSBEFOREEVENT(TS, EVENT) where EVENT can be either a tsdata.event object or a string. If EVENT is a tsdata.event object, the time

defined by EVENT is used. If EVENT is a string, the first tsdata.event

object in the Events property of TS that matches the EVENT name is used

to specify the time.

GETTSBEFOREEVENT(TS, EVENT, N) where N is the Nth appearance of the

matching EVENT name.

Note: If the time series TS contains date strings and EVENT uses

relative time, the time selected by the EVENT is treated as a date

(calculated relative to the StartDate property in the TS.TimeInfo

property). If TS uses relative time and EVENT uses dates, the time

selected by the EVENT is treated as a relative value.

See also timeseries/gettsafterevent, timeseries/gettsbeforeatevent,

timeseries/gettsbetweenevents

<timeseries/gettsbetweenevents> - Extract samples occurring between two specified events.

GETTSBETWEENEVENTS Return a new timeseries object with all the samples

occurring at and between two specified vents.

GETTSBETWEENEVENTS(TS, EVENT1, EVENT2). where EVENT can be either a tsdata.event object or a string. If EVENT is a tsdata.event object, the time

defined by EVENT is used. If EVENT is a string, the first tsdata.event

object in the Events property of TS that matches the EVENT name is used

to specify the time.

GETTSBETWEENEVENTS(TS, EVENT1, EVENT2, N1, N2) where N is the Nth appearance of the matching EVENT name for each specified event.

Note: If the time series TS contains date strings and EVENT uses

relative time, the time selected by the EVENT is treated as a date

(calculated relative to the StartDate property in the TS.TimeInfo

property). If TS uses relative time and EVENT uses dates, the time

selected by the EVENT is treated as a relative value.

See also timeseries/gettsafterevent, timeseries/gettsbeforeevent,

Соседние файлы в папке Библиотеки Matlab