www.gusucode.com > fininst 案例源码程序 matlab代码 > fininst/SetLevelsAndNodeHullWhiteTreeExample.m

    %% Set the Number of Levels and Node Times for a Hull-White Tree
% This example shows how to specify a four-period tree with annual nodes
% and use annual compounding to report rates.
%%

% Copyright 2015 The MathWorks, Inc.

ValuationDate = 'Jan-1-2004';
Maturity = ['12-31-2004'; '12-31-2005'; '12-31-2006'; 
'12-31-2007'];
Compounding = 1;
TimeSpec = hwtimespec(ValuationDate, Maturity, Compounding)