IRIS Toolbox Reference Manual

## dbclip

Clip all tseries entries in database down to specified date range

#### Syntax

    D = dbclip(D,Range)

#### Input arguments

- `D` [ struct ] - Database or nested databases with tseries objects.

- `Range` [ numeric | cell ] - Range or a cell array of ranges to which all tseries objects will be clipped; multiple ranges can be specified, each for a different date frequency/periodicity.

#### Output arguments

- `D` [ struct ] - Database with tseries objects cut down to `range`.

#### 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]

IRIS Toolbox. Copyright © 2007—2013 Jaromir Benes.