%% Build a STTTree
% Create a RateSpec.

StartDates = 'Jan-1-2014'; 
EndDates = 'Jan-1-2018'; 
Rates = 0.025; 
Basis = 1; 
Compounding = -1;
RateSpec = intenvset('ValuationDate', StartDates, 'StartDates', StartDates,...
'EndDates', EndDates, 'Rates', Rates,'Compounding', Compounding, 'Basis', Basis)

%
% Create a StockSpec.

AssetPrice = 55; 
Sigma = 0.22; 
Div = 0.02; 
StockSpec = stockspec(Sigma, AssetPrice, 'continuous', Div)

%
% Create a Standard Trinomial Tree (STTTree).

NumSteps = 8;
TimeSpec = stttimespec(StartDates, EndDates, NumSteps);
STTT = stttree(StockSpec, RateSpec, TimeSpec)

% Copyright 2015 The MathWorks, Inc.