Financial Time Series Toolbox    
subsref

Subscripted reference

Description

subsref implements indexing for a financial time series object. Integer indexing or date (and time) string indexing is allowed. 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 returns the appropriate entry(ies) from the object.

Additionally, subsref lets you access the individual components of the object using the structure syntax.

Examples

Create a time series named myfts:

Extract the data for the single day July 1, 1998:

Now, extract the data for the range of dates July 1, 1998 through July 5, 1998:

You can use the MATLAB structure syntax to access the individual components of a financial time series object. To get the description field of myfts, enter

at the command line, which returns

Similarly

returns

The syntax for integer indexing is the same as for any other MATLAB matrix. Create a new financial time series object containing both dates and times:

Use integer indexing to extract the second and third data items from the object.

For date or string enclose the indexing string in a pair of single quotation marks.

If there is one date with multiple times, indexing with only the date returns all the times for that specific date:

To specify one specific date and time, index with that date and time:

To specify a range of dates and times, use the double colon (::) operator:

To request all the dates, times, and data, use the :: operator without specifiying any specific date or time:

See Also

fts2mtx, subsasgn

datestr in the Financial Toolbox documentation


  subsasgn times