Main Content

removeDataSource

Remove reference data dictionary from parent data dictionary

Description

example

removeDataSource(dictionaryObj,refDictionaryFile) removes a referenced data dictionary, refDictionaryFile, from a parent dictionary dictionaryObj, a Simulink.data.Dictionary object.

The parent dictionary no longer contains the entries that are defined in the referenced dictionary.

Examples

collapse all

Open the data dictionary myDictionary_ex_API.sldd and represent it with a Simulink.data.Dictionary object named myDictionaryObj. The DataSources property of myDictionaryObj indicates myDictionary_ex_API.sldd references myRefDictionary_ex_API.sldd.

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

  Dictionary with properties:

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

Remove myRefDictionary_ex_API.sldd from myDictionary_ex_API.sldd.

removeDataSource(myDictionaryObj,'myRefDictionary_ex_API.sldd');

View the properties of the Simulink.data.Dictionary object myDictionaryObj, which represents the parent data dictionary. The DataSources property confirms the removal of myRefDictionary_ex_API.sldd.

myDictionaryObj
myDictionaryObj = 

  Dictionary with properties:

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

Input Arguments

collapse all

Parent data dictionary, specified as a Simulink.data.Dictionary object. Before you use this function, represent the target dictionary with a Simulink.data.Dictionary object by using, for example, the Simulink.data.dictionary.create or Simulink.data.dictionary.open function.

File name of referenced data dictionary, specified as a character vector that includes the .sldd extension. The data dictionary file must be on your MATLAB path.

Example: 'myRefDictionary_ex_API.sldd'

Data Types: char

Alternatives

You can use Model Explorer to manage reference dictionaries. See Partition Dictionary Data Using Referenced Dictionaries for more information.

Version History

Introduced in R2015a