%% Compute the Price of an Amortizing and Vanilla Floors Using the BK Model
% Load deriv.mat to specify the BKTree and then define the floor instrument.

load deriv.mat; 
Settle = '01-Jan-2004';
Maturity = '01-Jan-2008';
Strike = 0.045;
Reset = 1;
Principal ={{'01-Jan-2005' 100;'01-Jan-2006' 60;'01-Jan-2007' 30;'01-Jan-2008' 30};...
            100};

%
% Price the amortizing and vanilla floors.

Basis = 1;
Price = floorbybk(BKTree, Strike, Settle, Maturity, Reset, Basis, Principal)

% Copyright 2015 The MathWorks, Inc.