coder.dictionary.Section.addEntry - Add a new entry to Embedded Coder Dictionary section - MATLAB (original) (raw)
Main Content
Class: coder.dictionary.Section
Namespace: coder.dictionary
Add a new entry to Embedded Coder Dictionary section
Syntax
addEntry(sectionObj,defName) entryObj = addEntry(sectionObj,entryName)
Description
addEntry([sectionObj](#mw%5F1ff4c175-10b3-4190-b5d7-8f96b0732c4f),[defName](#mw%5F945adcbe-f49e-4423-8579-54262d03876a))
adds a definition named defName
to the Embedded Coder Dictionary sectionsectionObj
, a coder.dictionary.Section object.
[entryObj](#mw%5F6219a39b-f02f-4e6b-808e-cca090685eb2) = addEntry([sectionObj](#mw%5F1ff4c175-10b3-4190-b5d7-8f96b0732c4f),`entryName`)
returns a coder.dictionary.Entry object that represents the new Embedded Coder Dictionary definition.
Input Arguments
Section in the Embedded Coder Dictionary, specified as acoder.dictionary.Section
object. The section name identifies the type of code definition that addEntry
creates.
Name of newly created Embedded Coder Dictionary definition, specified as a character vector or string scalar.
Example: 'StorageClass2'
Output Arguments
New Embedded Coder Dictionary entry, returned as acoder.dictionary.Entry
object. The new entry represents the new code definition in the section of the Embedded Coder Dictionary.
Examples
Open the model RollAxisAutopilot
and represent the Embedded Coder Dictionary by using a coder.Dictionary
object. Use this object to access the Storage Classes section of the dictionary, which contains the storage class definitions.
openExample('RollAxisAutopilot') coderDictionary = coder.dictionary.open('RollAxisAutopilot');
Create a coder.dictionary.Section
object that represents the Storage Classes section of the Embedded Coder Dictionary.
storageClassesSect = getSection(coderDictionary, 'StorageClasses');
Add a storage class definition named MyStorageClass
to the Storage Classes section. The storage class definition uses the default property settings. You can change these settings by using the set function.
newEntry = addEntry(storageClassesSect,'MyStorageClass')
newEntry =
Entry with properties:
Name: 'MyStorageClass'
DataSource: 'RollAxisAutopilot'
Version History
Introduced in R2019b