cpndaysp
Number of days since previous coupon date
Syntax
Description
returns
the number of days between the previous coupon date and the settlement
date for a bond or set of bonds. When the coupon frequency is 0 (a
zero coupon bond), the previous coupon date is calculated as if the
frequency were semiannual. NumDaysPrevious
= cpndaysp(Settle
,Maturity
)NumDaysPrevious
returns
a double for serial date number, date character vector, and datetime
inputs.
Required input arguments must be number of bonds, NUMBONDS
-by-1
or 1
-by-NUMBONDS
,
conforming vectors or scalars.
returns the number of days between the previous coupon date and the
settlement date for a bond or set of bonds using optional input arguments. NumDaysPrevious
= cpndaysp(___,Period
,Basis
,EndMonthRule
,IssueDate
,FirstCouponDate
,LastCouponDate
)
Optional input arguments must be either NUMBONDS
-by-1
or 1
-by-NUMBONDS
conforming
vectors, scalars, or empty matrices.
If all the inputs for Settle
, Maturity
,
IssueDate
, FirstCouponDate
, and
LastCouponDate
are either serial date numbers or date
character vectors, then NumDaysPrevious
is returned as a
serial date number. The function datestr
converts a serial date
number to a formatted date character vector.
If any of the inputs for Settle
, Maturity
,
IssueDate
, FirstCouponDate
, and
LastCouponDate
are datetime arrays, then
NumDaysPrevious
is returned as a datetime array.