主要内容

getEntry

类: coder.dictionary.Section
命名空间: coder.dictionary

返回表示 Embedded Coder 字典定义的 coder.dictionary.Entry 对象

语法

entryObj = getEntry(sectionObj,defName)

说明

entryObj = getEntry(sectionObj,defName) 返回 coder.dictionary.Entry 对象,表示在分区 sectionObjcoder.dictionary.Section 对象)中找到的名为 defName 的 Embedded Coder 字典定义。

输入参数

全部展开

包含代码定义的 Embedded Coder 字典分区,指定为 coder.dictionary.Section 对象。分区名称标识代码定义的类型。

Embedded Coder 字典定义的名称,指定为字符向量或字符串标量。

示例: 'StorageClass2'

输出参量

全部展开

Embedded Coder 字典条目,以 coder.dictionary.Entry 对象形式返回。该条目表示 Embedded Coder 字典分区中的代码定义。

示例

全部展开

打开模型 RollAxisAutopilot,并使用 coder.Dictionary 对象表示 Embedded Coder 字典。使用此对象可以访问字典的存储类分区,其中包含存储类定义。

openExample('RollAxisAutopilot')
coderDictionary = coder.dictionary.open('RollAxisAutopilot');

创建一个 coder.dictionary.Section 对象,它表示 Embedded Coder 字典的存储类分区。

storageClassesSect = getSection(coderDictionary, 'StorageClasses');

使用 coder.dictionary.Entry 对象表示示例存储类 ParamStruct

entryObj = getEntry(storageClassesSect,'ParamStruct')
Entry with properties:

          Name: 'ParamStruct'
    DataSource: 'RollAxisAutopilot'

版本历史记录

在 R2019b 中推出