%% Determine Shape of Recombining Binomial Tree
% This example shows how to obtain information on a recombining binomial tree's shape.
% Create a BDT tree by loading the example file.

load deriv.mat; 

% With treeviewer you can see the general shape of the BDT interest-rate tree.

treeviewer(BDTTree)

% Use treeshape to display the shape of the binomial tree.

[NumLevels, NumPos, IsPriceTree] = treeshape(BDTTree.FwdTree) 

% Copyright 2020 The MathWorks, Inc.