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

    %% Price a Floating-Rate Note Using a Set of Zero Curves  
% Price a 20-basis point floating-rate note using a set of zero curves.   

% Copyright 2015 The MathWorks, Inc.


%% 
% Load |deriv.mat|, which provides |ZeroRateSpec|, the interest-rate term
% structure, needed to price the bond. 
load deriv.mat;   

%% 
% Define the floating-rate note using the required arguments. Other arguments
% use defaults. 
Spread = 20;
Settle = '01-Jan-2000';
Maturity = '01-Jan-2003';  

%% 
% Use |floatbyzero| to compute the price of the note. 
Price = floatbyzero(ZeroRateSpec, Spread, Settle, Maturity)