vertcat

Concatenate financial time series objects vertically

Syntax

vertcat

Description

vertcat implements vertical concatenation of financial time series objects. vertcat essentially adds data points to a time series object. Objects to be vertically concatenated must not have any duplicate dates and/or times or any overlapping dates and/or times. The description fields are concatenated as well. They are separated by ||.

Examples

Create two financial time series objects with daily frequencies:

myfts   = fints((today:today+4)', (1:5)', 'DataSeries', 'd');
yourfts = fints((today+5:today+9)', (11:15)', 'DataSeries', 'd');

Use vertcat to concatenate them vertically:

newfts1 = [myfts; yourfts]
newfts1 = 
 
    desc:   || 
    freq:  Daily (1)

    'dates:  (10)'    'DataSeries:  (10)'
    '11-Dec-2001'     [                1]
    '12-Dec-2001'     [                2]
    '13-Dec-2001'     [                3]
    '14-Dec-2001'     [                4]
    '15-Dec-2001'     [                5]
    '16-Dec-2001'     [               11]
    '17-Dec-2001'     [               12]
    '18-Dec-2001'     [               13]
    '19-Dec-2001'     [               14]
    '20-Dec-2001'     [               15]

Create two financial time series objects with different frequencies:

myfts   = fints((today:today+4)', (1:5)', 'DataSeries', 'd');
hisfts  = fints((today+5:7:today+34)', (11:15)', 'DataSeries',... 
'w');

Concatenate these two objects vertically:

newfts2 = [myfts; hisfts]
 newfts2 = 
 
    desc:   || 
    freq:  Unknown (0)

    'dates:  (10)'    'DataSeries:  (10)'
    '11-Dec-2001'     [                1]
    '12-Dec-2001'     [                2]
    '13-Dec-2001'     [                3]
    '14-Dec-2001'     [                4]
    '15-Dec-2001'     [                5]
    '16-Dec-2001'     [               11]
    '23-Dec-2001'     [               12]
    '30-Dec-2001'     [               13]
    '06-Jan-2002'     [               14]
    '13-Jan-2002'     [               15]

If all frequency indicators are the same, the new object has the same frequency indicator. However, if one of the concatenated objects has a different freq from the other(s), the frequency of the resulting object is set to Unknown (0). In these examples, newfts1 has Daily frequency, while newfts2 has Unknown (0) frequency.

See Also

Was this topic helpful?