Financial Time Series Toolbox    

Object to Matrix Conversion

The function fts2mtx extracts the dates and/or the data series values from an object and places them into a vector or a matrix. The default behavior extracts just the values into a vector or a matrix. Look at the next example:

If you want to include the dates in the output matrix, provide a second input argument and set it to 1. This results in a matrix whose first column is a vector of serial date numbers:

The vector srs2_vec contains just series2 values. The matrix srs2_mtx contains dates in the first column and the values of the series2 data series in the second. Dates in the first column are in serial date format. Serial date format is a representation of the date string format (for example, serial date = 1 is equivalent to 01-Jan-0000). (The serial date vector may include time-of-day information.)

The long g display format displays the numbers without exponentiation. (To revert to the default display format, use format short. See the format command in the MATLAB documentation for a description of MATLAB display formats.) Remember that both the vector and the matrix have 101 rows of data as in the original object myfts but are shown truncated here.


  Data Extraction Indexing a Financial Time Series Object