%% Price Three Bonds Using Two Different Curves
% To price three bonds using two different curves, define the RateSpec:

StartDates = '01-April-2016';
EndDates = ['01-April-2017'; '01-April-2018';'01-April-2019';'01-April-2020'];
Rates = [[0.0356;0.041185;0.04489;0.047741],[0.0325;0.0423;0.0437;0.0465]];
RateSpec = intenvset('Rates', Rates, 'StartDates',StartDates,...
'EndDates', EndDates, 'Compounding', 1)

%
% Price three bonds with the same Maturity and different coupons.

Settle = '01-April-2016';
Maturity = '01-April-2020';
Price = bondbyzero(RateSpec,[0.025;0.028;0.035],Settle,Maturity)

% Copyright 2012 The MathWorks, Inc.