Documentation

Simulink.data.Dictionary class

Package: Simulink.data
Superclasses:

Configure data dictionary

Description

An object of the Simulink.data.Dictionary class represents a data dictionary. The object allows you to perform operations on the data dictionary such as save or discard changes, import data from the base workspace, and add other data dictionaries as references.

Construction

The functions Simulink.data.dictionary.create and Simulink.data.dictionary.open create a Simulink.data.Dictionary object.

Properties

expand all

Referenced data dictionaries by file name, returned as a cell array of character vectors. This property only lists directly referenced dictionaries whose parent is the Simulink.data.Dictionary object. This property is read only.

Indicator of unsaved changes to the data dictionary, returned as 0 or 1. The value is 1 if changes have been made since last data dictionary save and 0 if not. This property is read only.

Total number of entries in data dictionary, including those in referenced dictionaries, returned as an integer. This property is read only.

Methods

addDataSourceAdd reference data dictionary to parent data dictionary
closeClose connection between data dictionary and Simulink.data.Dictionary object
discardChangesDiscard changes to data dictionary
filepathFull path and file name of data dictionary
getSectionReturn Simulink.data.dictionary.Section object to represent data dictionary section
hideRemove data dictionary from Model Explorer
importEnumTypesImport enumerated type definitions to data dictionary
importFromBaseWorkspaceImport base workspace variables to data dictionary
listEntryList data dictionary entries
removeDataSourceRemove reference data dictionary from parent data dictionary
saveChangesSave changes to data dictionary
showShow data dictionary in Model Explorer

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects (MATLAB).

Examples

expand all

Create a data dictionary file myNewDictionary.sldd and a Simulink.data.Dictionary object representing the new data dictionary. Assign the object to variable dd1.

dd1 = Simulink.data.dictionary.create('myNewDictionary.sldd')
dd1 = 

  data dictionary with properties:

          DataSources: {0x1 cell}
    HasUnsavedChanges: 0
           NumberOfEntries: 0

Create a Simulink.data.Dictionary object representing the existing data dictionary myDictionary_ex_API.sldd. Assign the object to variable dd2.

dd2 = Simulink.data.dictionary.open('myDictionary_ex_API.sldd')
dd2 = 

  Dictionary with properties:

          DataSources: {'myRefDictionary_ex_API.sldd'}
    HasUnsavedChanges: 0
           NumberOfEntries: 4

Introduced in R2015a

Was this topic helpful?