getSections

Class: coder.Dictionary
Package: coder

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

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.

Examples

expand all

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

rtwdemo_roll
coderDictObj = coder.dictionary.open('rtwdemo_roll')
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'
Introduced in R2019b