%% Use getForwardRates to Compute the Five Year Forward Rate in Five Years Time
% Use getForwardRates to compute the forward rate from the Settle date to 5 years from March 1, 2017 and then the forward rate for the period from 5 years to 10 years from March 1, 2017.

Data = [2.09 2.47 2.71 3.12 3.43 3.85 4.57 4.58]/100;
Dates = daysadd(736755,[360 2*360 3*360 5*360 7*360 10*360 20*360 30*360],1);
irdc = IRDataCurve('Zero',today,Dates,Data);
getForwardRates(irdc,datemnth(irdc.Settle,12*[5 10]))

% The first element (.0312) is the forward rate from the Settle to 5 years from March 1, 2017. The second rate (0.0458) is the forward rate for the period from 5 years to 10 years from March 1, 2017, in other words, the 5-year forward rate 5 years from March 1, 2017.
% Copyright 2012 The MathWorks, Inc.