%% Compute Yield to Maturity for a Treasury Bond
% This example shows how to compute the yield of a Treasury bond at three different price values.

Price = [95; 100; 105]; 
CouponRate = 0.05; 
Settle = '20-Jan-1997'; 
Maturity = '15-Jun-2002'; 
Period = 2; 
Basis = 0; 

Yield = bndyield(Price, CouponRate, Settle,... 
Maturity, Period, Basis)

% Copyright 2015 The MathWorks, Inc.