%% Find Bond Duration Given Price
% This example shows how to compute the duration of three bonds given their prices.

Price = [106; 100; 98]; 
CouponRate = 0.055; 
Settle = '02-Aug-1999'; 
Maturity = '15-Jun-2004'; 
Period = 2; 
Basis = 0; 

[ModDuration, YearDuration, PerDuration] = bnddurp(Price,...
CouponRate, Settle, Maturity, Period, Basis)

% Copyright 2015 The MathWorks, Inc.