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