%% Price a Treasury Bond from Yield to Maturity
% This example shows how to price a treasury bond at three different yield values.

Yield = [0.04; 0.05; 0.06]; 
CouponRate = 0.05; 
Settle = '20-Jan-1997'; 
Maturity = '15-Jun-2002'; 
Period = 2; 
Basis = 0; 

[Price, AccruedInt] = bndprice(Yield, CouponRate, Settle,...
Maturity, Period, Basis)

% Copyright 2015 The MathWorks, Inc.