Financial Derivatives Toolbox | ![]() ![]() |
Create financial structure or return financial structure class name
Syntax
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 an 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-2002'); TimeSpec.Compounding = 2; TimeSpec.Basis = 0; TimeSpec.EndMonthRule = 1; TimeSpec = FinObj: 'HJMTimeSpec' ValuationDate: 730464 Maturity: 731560 Compounding: 2 Basis: 0 EndMonthRule: 1
Convert an existing MATLAB structure into a financial structure.
TSpec.ValuationDate = datenum('Dec-10-1999'); TSpec.Maturity = datenum('Dec-10-2002'); TSpec.Compounding = 2; TSpec.Basis = 0; TSpec.EndMonthRule = 0; TimeSpec = classfin(TSpec, 'HJMTimeSpec') TimeSpec = ValuationDate: 730464 Maturity: 731560 Compounding: 2 Basis: 0 EndMonthRule: 0 FinObj: 'HJMTimeSpec'
Obtain a financial structure's class name.
See Also
![]() | cfbyzero | date2time | ![]() |