| Fixed-Income Toolbox™ | ![]() |
F = toratespec(CurveObj, InpDates)
| 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. |
F = toratespec(CurveObj, InpDates) returns a RateSpec object that is identical to the RateSpec structure created by the Financial Derivatives Toolbox function intenvset.
This example creates an IRDataCurve object from the IRDataCurve constructor using Dates and Data and then is converted to a RateSpec structure using the toRateSpec method:
Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = daysadd(today,[360 2*360 3*360 5*360 7*360 10*360 20*360 30*360],1);
irdc = IRDataCurve('Forward',today,Dates,Data)
irdc.toRateSpec(today+30:30:today+365)
irdc =
IRDataCurve handle
Properties:
Dates: [8x1 double]
Data: [8x1 double]
InterpMethod: 'linear'
Type: 'Forward'
Settle: 733596
Compounding: 2
Basis: 0
Methods, Events, Superclasses
ans =
FinObj: 'RateSpec'
Compounding: 2
Disc: [12x1 double]
Rates: [12x1 double]
EndTimes: [12x1 double]
StartTimes: [12x1 double]
EndDates: [12x1 double]
StartDates: 733596
ValuationDate: 733596
Basis: 0
EndMonthRule: 1![]() | tfutyieldbyrepo | toRateSpec | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |