Main Content

indexvalues

Calculate index values for inflationcurve object

Since R2021a

Description

outIndexValues = indexvalues(inpInflationCurve,inpDates) calculates the inflation index values for the inflationcurve object (inpInflationCurve) based on the Inflation index end dates (inpDates).

example

Examples

collapse all

Create an inflationcurve object using inflationcurve.

BaseDate = datetime(2020,9,20);
InflationTimes = [0 calyears([1 2 3 4 5 7 10 20 30])]';
InflationIndexValues = [100 102 103.5 105 106.8 108.2 111.3 120.1 130.4 150.2]';
InflationDates = BaseDate + InflationTimes;
myInflationCurve = inflationcurve(InflationDates,InflationIndexValues);

Compute the index values using indexvalues.

outIndexValues = indexvalues(myInflationCurve,datetime(2023,9,20))
outIndexValues = 
105

Input Arguments

collapse all

Inflation curve, specified using a previously created inflationcurve object.

Data Types: object

Inflation index end dates, specified as a NINST-by-1 vector using a datetime array, string array, or date character vectors.

To support existing code, indexvalues also accepts serial date numbers as inputs, but they are not recommended.

Output Arguments

collapse all

Output inflation index values, returned as a numeric.

Version History

Introduced in R2021a

expand all