Return file names and paths of open data dictionaries
the file names and paths of all data dictionaries that are open. For
example, a data dictionary is open if you create objects, such as
openDDs = Simulink.data.dictionary.getOpenDictionaryPaths
that refer to the dictionary. If you open two or more dictionaries
that have the same file name but different file paths, this function
returns multiple file paths.
Before executing commands and functions that cannot operate
when dictionaries are open, use this function to identify open dictionaries
so that you can close them. For example, when you run parallel simulations
as described in Sweep Variant Control Using Parallel Simulation,
this function helps you identify open dictionaries before executing
the file paths of data dictionaries that have the file name
openDDs = Simulink.data.dictionary.getOpenDictionaryPaths(
If you open two or more dictionaries that have the same file name
but different file paths, you can use this syntax to return all of
the file paths.
Identify and Close All Open Data Dictionaries
Open, identify, and close a data dictionary.
After you close the connections to the dictionary, you can use commands
and functions, such as
that cannot operate when dictionaries are open.
At the command prompt, open a data dictionary by creating a
Simulink.data.Dictionary object that refers to
For example, open the Using a Data Dictionary to Manage the Data for a Fuel Control System example data dictionary.
openExample('simulink_automotive/UseDDForFuelContSysExample' dictObj = Simulink.data.dictionary.open('sldemo_fuelsys_dd.sldd');
Display the dictionary in the Model Explorer
Identify all of the dictionaries that are open.
openDDs = Simulink.data.dictionary.getOpenDictionaryPaths;
The file path of the dictionary that you opened,
appears in the cell array of character vectors
Close the connection from the Model Explorer to the dictionary.
The dictionary no longer appears as a node in the Model Hierarchy pane of the Model Explorer.
Close the connection from the
to the dictionary.
close(dictObj) clear dictObj
dictFileName — File name of target data dictionary or dictionaries
File name of target data dictionary or dictionaries, specified
as a character vector. Use the file extension
openDDs — File names and paths of open data dictionaries
cell array of character vectors
File names and paths of open data dictionaries, returned as a cell array of character vectors.
A data dictionary is open if any of these conditions are true:
The dictionary appears as a node in the Model Hierarchy pane of the Model Explorer. To close this connection to the dictionary, right-click the node in Model Explorer and select Close. Alternatively, use the
hidemethod of a
You created an object of any of these classes that refer to the dictionary:
To close these connections to the dictionary, use the
closemethod of the
Simulink.data.Dictionaryobject or clear the object. Clear the
A model that is linked to the dictionary is open. To close this connection to the dictionary, close the model.