This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

set

Set timeseries properties

Syntax

tsprop = set(ts)
tsprop = set(ts,propname)
tsprop = set(ts,propname,propval)

Description

tsprop = set(ts) returns all property values of a timeseries object ts.

tsprop = set(ts,propname) returns the property specified in propname. This syntax is equivalent to the command tsprop = ts.propname. For a full list of timeseries property names, see timeseries.

example

tsprop = set(ts,propname,propval) sets the property propname of ts to the value propval. This syntax is equivalent to the command ts.propname = propval. For a full list of timeseries property names and corresponding valid values, see timeseries.

Examples

collapse all

Create an unnamed timeseries object, and use the set function to assign a name to the Name property.

ts = timeseries((1:5));
tsprop = set(ts,'Name','newname')
  timeseries

  Common Properties:
            Name: 'newname'
            Time: [5x1 double]
        TimeInfo: tsdata.timemetadata
            Data: [1x1x5 double]
        DataInfo: tsdata.datametadata

Input Arguments

collapse all

Input timeseries, specified as a scalar.

Data Types: timeseries

Property name, specified as a character vector. For a full list of timeseries property names, see timeseries.

Data Types: char

Property value, specified as a scalar. For a full list of timeseries property names and valid values, see timeseries.

See Also

|

Introduced before R2006a