Main Content

getSection

Class: coder.Dictionary
Package: coder

Return coder.dictionary.Section object that represents Embedded Coder Dictionary section

Syntax

sectionObj = getSection(coderDictionaryObj,sectionName)

Description

sectionObj = getSection(coderDictionaryObj,sectionName) returns a coder.dictionary.Section object that represents one section, sectionName, of an Embedded Coder Dictionary, which coderDictionaryObj represents. Use the section to access the code definitions of the type identified by the section name.

Input Arguments

expand all

Embedded Coder Dictionary containing section that you want to access, 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.

Name of section that you want to access in the Embedded Coder Dictionary, specified as a string. The section name identifies the type of code definitions that the section contains.

Example: 'StorageClasses'

Output Arguments

expand all

Section in the Embedded Coder Dictionary, returned as a coder.dictionary.Section object. The section contains coder.dictionary.Entry objects that represent code definitions of the type identified by sectionName.

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]

Represent the Storage Classes section of the Embedded Coder Dictionary by using a coder.dictionary.Section object named SCSectObj.

SCSectObj = getSection(coderDictObj,'StorageClasses')
SCSectObj = 

  Section with properties:

    Name: 'StorageClasses'
Introduced in R2019b