www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/PriceaBondUsingaBDTTreeExample.m

    %% Price a Bond Using a BDT Tree  
% Price a 10% bond using a BDT interest-rate tree.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Load |deriv.mat|, which provides |BDTTree|. The |BDTTree| structure contains
% the time and interest-rate information needed to price the bond.  
load deriv.mat;   

%% 
% Define the bond using the required arguments. Other arguments use defaults. 
CouponRate = 0.10;
Settle = '01-Jan-2000';
Maturity = '01-Jan-2003';
Period = 1;  

%% 
% Use |bondbybdt| to compute the price of the bond. 
Price = bondbybdt(BDTTree, CouponRate, Settle, Maturity, Period)