%% Find Bond Duration Given Yield
% This example shows how to compute the duration of a bond at three different yield values.

Yield = [0.04; 0.055; 0.06];  
CouponRate = 0.055; 
Settle = '02-Aug-1999'; 
Maturity = '15-Jun-2004'; 
Period = 2; 
Basis = 0; 

[ModDuration,YearDuration,PerDuration]=bnddury(Yield,... 
CouponRate, Settle, Maturity, Period, Basis)

% Copyright 2015 The MathWorks, Inc.