Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

tsprops - Help on timeseries object properties

Syntax

help timeseries/tsprops

Description

help timeseries/tsprops lists the properties of the timeseries object and briefly describes each property.

Time Series Object Properties

Property

Description

Data

Time-series data, where each data sample corresponds to a specific time.

The data can be a scalar, a vector, or a multidimensional array. Either the first or last dimension of the data must be aligned with Time.

By default, NaNs are used to represent missing or unspecified data. Set the TreatNaNasMissing property to determine how missing data is treated in calculations.

DataInfo

Contains fields for storing contextual information about Data:

  • Unit — String that specifies data units

  • Interpolation — A tsdata.interpolation object that specifies the interpolation method for this time series.

    Fields of the tsdata.interpolation object include:

    • Fhandle — Function handle to a user-defined interpolation function

    • Name — String that specifies the name of the interpolation method. Predefined methods include 'linear' and 'zoh' (zero-order hold). 'linear' is the default.

  • UserData — Any user-defined information entered as a string

Events

An array of tsdata.event objects that stores event information for this time series. You add events by using the addevent method.

Fields of the tsdata.event object include the following:

  • EventData — Any user-defined information about the event

  • Name — String that specifies the name of the event

  • Time — Time value when this event occurs, specified as a real number or a date string

  • Units — Time units

  • StartDate — A reference date specified in MATLAB date-string format. StartDate is empty when you have a numerical (non-date-string) time vector.

IsTimeFirst

Logical value (true or false) specifies whether the first or last dimension of the Data array is aligned with the time vector.

You can set this property when the Data array is square and it is ambiguous which dimension is aligned with time. By default, the first Data dimension that matches the length of the time vector is aligned with the time vector.

When you set this property to:

  • true — The first dimension of the data array is aligned with the time vector. For example:
    ts=timeseries(rand(3,3),1:3, 'IsTimeFirst',true);

  • false — The last dimension of the data array is aligned with the time vector. For example:
    ts=timeseries(rand(3,3),1:3, 'IsTimeFirst',false);

After a time series is created, this property is read only.

Name

Time-series name entered as a string. This name can differ from the name of the time-series variable in the MATLAB workspace.

Quality

An integer vector or array containing values -128 to 127 that specifies the quality in terms of codes defined by QualityInfo.Code.

When Quality is a vector, it must have the same length as the time vector. In this case, each Quality value applies to a corresponding data sample.

When Quality is an array, it must have the same size as the data array. In this case, each Quality value applies to the corresponding value of the data array.

QualityInfo

Provides a lookup table that converts numerical Quality codes to readable descriptions. QualityInfo fields include the following:

  • Code — Integer vector containing values -128 to 127 that define the "dictionary" of quality codes, which you can assign to each Data value by using the Quality property

  • Description — Cell vector of strings, where each element provides a readable description of the associated quality Code

  • UserData — Stores any additional user-defined information

Lengths of Code and Description must match.

Time

Array of time values.

When TimeInfo.StartDate is empty, the numerical Time values are measured relative to 0 in specified units. When TimeInfo.StartDate is defined, the time values are date strings measured relative to the StartDate in specified units.

The length of Time must be the same as either the first or the last dimension of Data.

TimeInfo

Uses the following fields for storing contextual information about Time:

  • Units — Time units can have any of following values: 'weeks', 'days', 'hours', 'minutes', 'seconds', 'milliseconds', 'microseconds', or 'nanoseconds'

  • Start — Start time

  • End — End time (read only)

  • Increment — Interval between two subsequent time values

  • Length — Length of the time vector (read only)

  • Format — String defining the date string display format. See the MATLAB datestr function reference page for more information.

  • StartDate — Date string defining the reference date. See the MATLAB setabstime (timeseries) function reference page for more information.

  • UserData — Stores any additional user-defined information

TreatNaNasMissing

Logical value that specifies how to treat NaN values in Data:

  • true — (Default) Treat all NaN values as missing data except during statistical calculations.

  • false — Include NaN values in statistical calculations, in which case NaN values are propagated to the result.

See Also

datestr, get (timeseries), set (timeseries), setabstime (timeseries)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS