Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

toRateSpec

Convert IRFunctionCurve object to RateSpec

Syntax

F = toRateSpec(CurveObj, InpDates)

Arguments

CurveObj

Interest-rate curve object that is constructed using IRFunctionCurve.

InpDates

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

Description

F = toRateSpec(CurveObj, InpDates) returns a RateSpec object that is identical to the RateSpec structure created by the Financial Instruments Toolbox™ function intenvset.

Examples

collapse all

This example shows how to convert an IRFunctionCurve object to a RateSpec. First, an IRFunctionCurve object is created using the function IRFunctionCurve constructor, then a RateSpec structure is created using the toRateSpec method.

irfc = IRFunctionCurve('Forward',today,@(t) polyval([-0.0001 0.003 0.02],t));
toRateSpec(irfc, today+30:30:today+365)
ans = 

  struct with fields:

           FinObj: 'RateSpec'
      Compounding: 2
             Disc: [12×1 double]
            Rates: [12×1 double]
         EndTimes: [12×1 double]
       StartTimes: [12×1 double]
         EndDates: [12×1 double]
       StartDates: 736607
    ValuationDate: 736607
            Basis: 0
     EndMonthRule: 1

Related Examples

Introduced in R2008b

Was this topic helpful?