tmfactor

Time factors of arbitrary dates

Description

example

TMFactors = tmfactor(Settle,Maturity) determines the time factors from a vector of Settlement dates to a vector of Maturity dates.

Examples

collapse all

Find the TFactors for Settle and Maturity dates.

TFactors = tmfactor('1-Jan-2015','1-Jan-2016')
TFactors = 2

Find the TFactors for Settle and Maturity dates using a datetimes.

TFactors = tmfactor(datetime('1-Jan-2015','Locale','en_US'),datetime('1-Jan-2016','Locale','en_US'))
TFactors = 2

Input Arguments

collapse all

Settlement date, specified as a cell array of date character vectors, a vector of serial date numbers, or a datetime array.

Note

Settle must be earlier than Maturity.

Data Types: double | char | datetime

Maturity date, specified as a cell array of date character vectors, a vector of serial date numbers, or a datetime array.

Data Types: double | char | datetime

Output Arguments

collapse all

Time factors from a vector of Settle dates to a vector of Maturity dates, returned as a scalar numeric.

Introduced before R2006a