Financial Time Series Toolbox    
subsasgn

Content assignment

Description

subasgn assigns content to a component within a financial time series object. subasgn supports integer indexing or date string indexing into the time series object with values assigned to the designated components. Serial date numbers may not be used as indices. To use date string indexing, enclose the date string(s) in a pair of single quotation marks ' '.

You can use integer indexing on the object as in any other MATLAB matrix. It will return the appropriate entry(ies) from the object.

You must specify the component to which you want to assign values. An assigned value must be either a scalar or a column vector.

Examples

Given a time series myfts with a default data series name of series1

assigns the values 1, 2, and 3 corresponding to the first three days of July, 1998.

When the financial time series object contains a time-of-day specification, you can assign data to a specific time on a specific day. For example, create a financial time series object called timeday containing both dates and times:

Use integer indexing to assign the value 999 to the first item in the object.

For value assignment using date strings, enclose the string in single quotation marks. If a date has multiple times, designating only the date and assigning a value results in every element of that date taking on the assigned value. For example, to assign the value 0.5 to all times-of-day on January 1, 2001, enter

The result is

To access the individual components of the financial time series object, use the structure syntax. For example, to assign a range of data to all the data items in the series Data1, you can use

See Also

datestr in the Financial Toolbox documentation

subsref


  stochosc subsref