Main Content

coder.dictionary.create

Create Embedded Coder Dictionary and coder.Dictionary object

Since R2019b

Description

example

coderDictionaryObj = coder.dictionary.create(sourceName) creates an Embedded Coder Dictionary in the model or Simulink® data dictionary identified by sourceName. The function returns a coder.Dictionary object that represents the new Embedded Coder Dictionary.

When the source model or data dictionary already has an Embedded Coder Dictionary, use coder.dictionary.open to access the coder.Dictionary object. An Embedded Coder Dictionary is created when you open a model in the Embedded Coder app or when you open the Embedded Coder Dictionary dialog box for a model or a data dictionary.

Examples

collapse all

Create a data dictionary.

dataDictionary = Simulink.data.dictionary.create('DataDictionary.sldd');

Create an Embedded Coder Dictionary in the data dictionary.

coderDictionary = coder.dictionary.create(dataDictionary);
coderDictionary = 

  Dictionary with Sections:

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

Input Arguments

collapse all

Name of target model file or data dictionary, specified as a character vector, string scalar, or Simulink.data.Dictionary object.

  • A model must be loaded (for example, by using load_system) or open.

    You do not need to specify the .slx file extension.

  • A dictionary must be open in the Model Explorer, in the current folder, or on the MATLAB® path.

    You must specify the .sldd file extension.

Example: 'myLoadedModel'

Example: 'myDictionary.sldd'

Data Types: char

Output Arguments

collapse all

Newly created Embedded Coder Dictionary, returned as a coder.Dictionary object.

Version History

Introduced in R2019b