Main Content

chfield

Change data series name

chfield is not recommended. Use timetable instead. For more information, see Convert Financial Time Series Objects fints to Timetables.

Description

example

newfts = chfield(oldfts,oldname,newname) changes the name of the financial time series object component from oldname to newname.

Set newfts = oldfts to change the name of an existing component without changing the name of the financial time series object.

To change the names of several components at once, specify the series of old and new component names in corresponding column cell arrays.

You cannot change the names of the object components desc, freq, and dates.

Examples

collapse all

  1. Create a fints object.

     f = fints((today:today+1)', [4 -2 1; 9  5 7])
    Warning: FINTS will be removed in a future release. Use TIMETABLE instead. 
    > In fints (line 165) 
    Warning: FINTS will be removed in a future release. Use TIMETABLE instead. 
    > In fints/display (line 66) 
     
    f = 
     
        desc:  (none)
        freq:  Unknown (0)
    
        'dates:  (2)'    'series1:  (2)'    'series2:  (2)'    'series3:  (2)'
        '02-Oct-2017'    [            4]    [           -2]    [            1]
        '03-Oct-2017'    [            9]    [            5]    [            7]
    
  2. Change a data series name using chfield.

    newfts = chfield(f,'series2','series2A')
    newfts = 
     
        desc:  (none)
        freq:  Unknown (0)
    
        {'dates:  (2)'}    {'series1:  (2)'}    {'series2A:  (2)'}    {'series3:  (2)'}
        {'03-Sep-2021'}    {[            4]}    {[            -2]}    {[            1]}
        {'04-Sep-2021'}    {[            9]}    {[             5]}    {[            7]}

Input Arguments

collapse all

Financial time series object, specified as a fints object.

Data Types: object

Name of the existing component in oldfts, specified as a MATLAB® character vector or column cell array.

Data Types: char | cell

New name for the component in oldfts, specified as a MATLAB character vector or column cell array.

Data Types: char | cell

Output Arguments

collapse all

Financial time series object, returned as a fints object.

Version History

Introduced before R2006a