%% Price a Floating-Rate Note Using an HJM Tree
% Price a 20-basis point floating-rate note using an HJM forward-rate tree.
% Load the file deriv.mat, which provides HJMTree. The HJMTree structure contains the time and interest-rate information needed to price the note.

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 floatbyhjm to compute the price of the note.

Price = floatbyhjm(HJMTree, Spread, Settle, Maturity)

% Copyright 2015 The MathWorks, Inc.