Main Content

getSections

Class: coder.Dictionary
Namespace: coder

Return coder.dictionary.Section objects of an Embedded Coder Dictionary

Since R2019b

Syntax

sections = getSections(coderDictionaryObj)

Description

sections = getSections(coderDictionaryObj) returns the coder.dictionary.Section objects contained in the Embedded Coder Dictionary that coderDictionaryObj represents. Use the section objects to access code definitions of different types identified by the section names.

Input Arguments

expand all

Embedded Coder Dictionary, specified as a coder.Dictionary object. Before you use this function, represent the dictionary with a coder.Dictionary object by using, for example, the coder.dictionary.create function or the coder.dictionary.open function.

Output Arguments

expand all

Sections of the Embedded Coder Dictionary, returned as an array of coder.dictionary.Section objects. The sections in the dictionary depend on the code interface configuration type of the dictionary.

A service interface configuration contains these sections:

  • InitTermFunctions

  • PeriodicAperiodicFunctions

  • DataReceiverInterfaces

  • DataSenderInterfaces

  • DataTransferInterfaces

  • TimerInterfaces

  • ParameterTuningInterfaces

  • ParameterArgumentTuningInterfaces

  • MeasurementInterfaces

  • SubcomponentInitTermFunctions

  • SubcomponentPeriodicAperiodicFunctions

  • SharedUtilityFunctions

  • InternalData

  • Constants

  • StorageClasses

  • DataMemorySections

  • FunctionMemorySections

A data interface configuration contains these sections:

  • StorageClasses

  • MemorySections

  • FunctionCustomizationTemplates

Examples

expand all

Open the model RollAxisAutopilot and represent the Embedded Coder Dictionary by using a coder.Dictionary object. Assign the coder.Dictionary object to the variable coderDictObj.

openExample("RollAxisAutopilot")
coderDictObj = coder.dictionary.open("RollAxisAutopilot")
coderDictObj =

  Dictionary with Sections:

                    StorageClasses: [1×1 coder.dictionary.Section]
                    MemorySections: [1×1 coder.dictionary.Section]
    FunctionCustomizationTemplates: [1×1 coder.dictionary.Section]

Access the sections of the dictionary by using an array of the corresponding coder.dictionary.Section objects.

sectionsArray = getSections(coderDictObj)
sectionsArray = 

  1×3 Section array with properties:

    Name

Use each coder.dictionary.Section object to access the entries in that section of the dictionary. The first section contains entries that represent function customization template definitions.

sectObj = sectionsArray(1)
sectObj = 

  Section with properties:

    Name: 'FunctionCustomizationTemplates'

Version History

Introduced in R2019b

expand all