Financial Time Series | ![]() ![]() |
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 dates numbers may not be used as indices. To use date string indexing, enclose the date string(s) in a pair of single quotes '
'
.
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.
Example
Given a time series myfts
with a default data series name of series1
.
myfts.series1('07/01/98::07/03/98') = [1 2 3]';
assigns the values 1
, 2
, and 3
corresponding to the first three days of July, 1998.
myfts('07/01/98::07/05/98') ans = desc: Data Assignment freq: Daily (1) 'dates: (5)' 'series1: (5)' '01-Jul-1998' [ 1] '02-Jul-1998' [ 2] '03-Jul-1998' [ 3] '04-Jul-1998' [ 4561.2] '05-Jul-1998' [ 5612.3]
See Also
datestr
in the Financial Toolbox User's Guide, subsref
![]() | stochosc | subsref | ![]() |