getDiscountFactors

Get discount factors for input dates for IRDataCurve

Syntax

F = getDiscountFactors(CurveObj,InpDates)

Arguments

CurveObj

Interest-rate curve object that is constructed using IRDataCurve.

InpDates

Vector of input dates using MATLAB® date format. The input dates must be after the settle date.

Description

F = getDiscountFactors(CurveObj,InpDates) returns discount factors for the input dates.

Examples

collapse all

This example shows how to get discount factors for input dates for an IRDataCurve.

CurveSettle = datenum('2-Mar-2016');
Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = datemnth(CurveSettle,12*[1 2 3 5 7 10 20 30]);
irdc = IRDataCurve('Zero',CurveSettle,Dates,Data);
getDiscountFactors(irdc, CurveSettle+30:30:CurveSettle+720)
ans = 24×1

    0.9986
    0.9971
    0.9956
    0.9940
    0.9924
    0.9907
    0.9890
    0.9873
    0.9855
    0.9836
      ⋮

Introduced in R2008b