Main Content

intenvget

Properties of interest-rate structure

Description

example

ParameterValue = intenvget(RateSpec,ParameterName) obtains the value of the named parameter ParameterName extracted from the RateSpec.

Examples

collapse all

Use intenvset to set the interest-rate structure.

RateSpec = intenvset('Rates',0.05,'StartDates',... 
'20-Jan-2000','EndDates','20-Jan-2001')
RateSpec = struct with fields:
           FinObj: 'RateSpec'
      Compounding: 2
             Disc: 0.9518
            Rates: 0.0500
         EndTimes: 2
       StartTimes: 0
         EndDates: 730871
       StartDates: 730505
    ValuationDate: 730505
            Basis: 0
     EndMonthRule: 1

Use intenvget to extract values from the RateSpec.

[R, RateSpec] = intenvget(RateSpec,'Rates')
R = 0.0500
RateSpec = struct with fields:
           FinObj: 'RateSpec'
      Compounding: 2
             Disc: 0.9518
            Rates: 0.0500
         EndTimes: 2
       StartTimes: 0
         EndDates: 730871
       StartDates: 730505
    ValuationDate: 730505
            Basis: 0
     EndMonthRule: 1

Input Arguments

collapse all

Interest-rate specification, specified by the RateSpec obtained previously from intenvset or toRateSpec for an IRDataCurve or toRateSpec for an IRFunctionCurve.

Data Types: struct

Parameter name to be accessed, specified as a character vector. The value of the named parameter is extracted from the structure RateSpec. It is sufficient to type only the leading characters that uniquely identify the parameter. Case is ignored for parameter names.

Data Types: char

Output Arguments

collapse all

Value of the named parameter 'ParameterName' extracted from RateSpec, returned as a scalar value.

Version History

Introduced before R2006a