%% Convert an IRDataCurve Object to a RateSpec
% This example shows how to convert an IRDataCurve object to a RateSpec. First, an IRDataCurve object is created using the function IRDataCurve constructor with Dates and Data, then this object is converted to a RateSpec structure using the toRateSpec method.

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('Forward',CurveSettle,Dates,Data);
toRateSpec(irdc, CurveSettle+30:30:CurveSettle+365)

% Copyright 2012 The MathWorks, Inc.