instcf
Construct cash flow instrument
Syntax
Description
creates a new instrument set containing CashFlow instruments.InstSet
= instcf(CFlowAmounts
,CFlowDates
,Settle
)
adds CashFlow instruments to an existing instrument set.InstSet
= instcf(InstSet
,CFlowAmounts
,CFlowDates
,Settle
)
[
lists field meta-data for the CashFlow instrument.FieldList
,ClassList
,TypeString
] = instcf
Examples
Create Two Cash Flow Instruments
Create a new instrument variable with the following information:
CFlowAmounts =[5 NaN 5.5 105; 5 0 6 105];
CFlowDates = [732678, NaN, 733408,733774;
732678, 733034, 733408, 734774];
Settle= 'Jan-1-2015';
Basis = 1;
Create the new cash flow instruments.
InstSet = instcf(CFlowAmounts,CFlowDates,Settle,Basis)
InstSet = struct with fields:
FinObj: 'Instruments'
IndexTable: [1x1 struct]
Type: {'CashFlow'}
FieldName: {{4x1 cell}}
FieldClass: {{4x1 cell}}
FieldData: {{4x1 cell}}
Display the cash flow instruments.
instdisp(InstSet)
Index Type CFlowAmounts CFlowDates Settle Basis 1 CashFlow 5 NaN 5.5 105 01-Jan-2006 NaN 01-Jan-2008 01-Jan-2009 01-Jan-2015 1 2 CashFlow 5 0 6 105 01-Jan-2006 23-Dec-2006 01-Jan-2008 28-Sep-2011 01-Jan-2015 1
Input Arguments
InstSet
— Instrument variable
structure
Instrument variable, specified only when adding CashFlow instruments to an existing
instrument set. For more information on the InstSet
variable, see
instget
.
Data Types: struct
CFlowAmounts
— Cash flow amounts
matrix
Cash flow amounts, specified as a number of instruments (NINST
)
by maximum number of cash flows (MOSTCFS
) matrix of cash flow
amounts. Each row is a list of cash flow values for one instrument. If an instrument has
fewer than MOSTCFS
cash flows, the end of the row is padded with
NaN
s.
Data Types: double
CFlowDates
— Cash flow dates
serial date number
Cash flow dates, specified as an
NINST
-by-MOSTCFS
vector using serial date
numbers. Each entry contains the date of the corresponding cash flow in
CFlowAmounts
.
Data Types: double
Settle
— Settlement date
serial date number | date character vector
Settlement date on which the cash flows are priced, specified as a scalar serial date number or date character vector.
Data Types: double
| char
Basis
— Day-count basis
0
(actual/actual) (default) | integer from 0
to 13
(Optional) Day-count basis, specified as scalar or an
NINST
-by-1
vector.
0 = actual/actual
1 = 30/360 (SIA)
2 = actual/360
3 = actual/365
4 = 30/360 (PSA)
5 = 30/360 (ISDA)
6 = 30/360 (European)
7 = actual/365 (Japanese)
8 = actual/actual (ICMA)
9 = actual/360 (ICMA)
10 = actual/365 (ICMA)
11 = 30/360E (ICMA)
12 = actual/365 (ISDA)
13 = BUS/252
For more information, see Basis.
Data Types: double
Output Arguments
InstSet
— Variable containing a collection of instruments
structure
Variable containing a collection of instruments, returned as a structure.
Instruments are broken down by type and each type can have different data fields. Each
stored data field has a row vector or string for each instrument. For more information
on the InstSet
variable, see instget
.
FieldList
— Name of each data field for CashFlow instrument
cell array of character vectors
Name of each data field for a CashFlow instrument, returned as an
NFIELDS
-by-1
cell array of character
vectors.
ClassList
— Data class for each field
cell array of character vectors
Data class for each field, returned as an
NFIELDS
-by-1
cell array of character vectors.
The class determines how arguments are parsed. Valid character vectors are
'dble'
, 'date'
, and 'char'
.
TypeString
— Type of instrument
character vector
Type of instrument, returned as a character vector. For a CashFlow instrument,
TypeString = 'CashFlow'
.
Version History
Introduced before R2006a
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)