IRIS Toolbox Reference Manual

dbclip

Clip all tseries entries in database down to specified date range

Syntax

D = dbclip(D,Range)

Input arguments

Output arguments

Description

This functions looks up all tseries objects within the database d, including tseries objects nested in sub-databases, and cuts off any values preceding the start date of Range or following the end date of range. The tseries object comments, if any, are preserved in the new database.

If a tseries entry does not match the date frequency of the input range, a warning is thrown.

Multiple ranges can be specified in Range (as a cell array), each for a different date frequency/periodicity (i.e. one or more of the following: monthly, bi-monthly, quarterly, half-yearly, yearly, indeterminate). Each tseries entry will be clipped to the range that matches its date frequency.

Example

d = struct();
d.x = tseries(qq(2005,1):qq(2010,4),@rand);
d.y = tseries(qq(2005,1):qq(2010,4),@rand)

d =
   x: [24x1 tseries]
   y: [24x1 tseries]

dbclip(d,qq(2007,1):qq(2007,4))

ans =
    x: [4x1 tseries]
    y: [4x1 tseries]