Main Content

getDiscountFactors

Get discount factors for input dates for IRFunctionCurve

Syntax

F = getDiscountFactors(CurveObj,InpDates)

Arguments

CurveObj

Interest-rate curve object that is constructed using the IRFunctionCurve.

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 IRFunctionCurve.

irfc = IRFunctionCurve('Forward',today,@(t) polyval([-0.0001 0.003 0.02],t));
getDiscountFactors(irfc, today+30:30:today+720)
ans = 24×1

    0.9984
    0.9967
    0.9950
    0.9933
    0.9916
    0.9899
    0.9881
    0.9864
    0.9846
    0.9828
      ⋮

Introduced in R2008b