%% Price a Floating-Rate Note Using a Hull-White Tree
% Price a 20-basis point floating-rate note using a Hull-White interest-rate tree.
% Load the file deriv.mat, which provides HWTree. The HWTree 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-2004';
Maturity = '01-Jan-2007';

%
% Use floatbyhw to compute the price of the note.

Price = floatbyhw(HWTree, Spread, Settle, Maturity)

% Copyright 2015 The MathWorks, Inc.