| Financial Derivatives Toolbox | ![]() |
Create financial structure or return financial structure class name
Syntax
Obj = classfin(ClassName) Obj = classfin(Struct, ClassName) ClassName = classfin(Obj)
Arguments
ClassName |
String containing name of financial structure class. |
Struct |
MATLAB structure to be converted into a financial structure. |
Obj |
Name of a financial structure. |
Description
Obj = classfin(ClassName) and Obj = classfin(Struct, ClassName)
create a financial structure of class ClassName.
ClassName = classfin(Obj)
returns a string containing a financial structure's class name.
Examples
Create a HJMTimeSpec financial structure and complete its fields (Typically, the function hjmtimespec is used to create HJMTimeSpec structures).
TimeSpec = classfin('HJMTimeSpec');
TimeSpec.ValuationDate = datenum('Dec-10-1999');
TimeSpec.Maturity = datenum('Dec-10-2000');
TimeSpec.Compounding = 2;
TimeSpec.Basis = 0;
TimeSpec.EndMonthRule = 1;
TimeSpec =
FinObj: 'HJMTimeSpec'
Convert an existing MATLAB structure into a financial structure.
TSpec.ValuationDate = datenum('Dec-10-1999');
TSpec.Maturity = datenum('Dec-10-2000');
TSpec.Compounding = 2;
TSpec.Basis = 0;
TSpec.EndMonthRule = 0;
TimeSpec = classfin(TSpec, 'HJMTimeSpec')
TimeSpec =
ValuationDate: 730464
Maturity: 730830
Compounding: 2
Basis: 0
EndMonthRule: 0
FinObj: 'HJMTimeSpec'
Obtain a financial structure's class name.
load deriv.mat ClassName = classfin(HJMTree) ClassName = HJMFwdTree
See Also
| cfbyzero | date2time | ![]() |