Main Content

deleteEntry

Class: Simulink.data.dictionary.Section
Package: Simulink.data.dictionary

Delete data dictionary entry

Syntax

deleteEntry(sectionObj,entryName)
deleteEntry(sectionObj,entryName,'DataSource',dictionaryName)

Description

deleteEntry(sectionObj,entryName) deletes a data dictionary entry entryName from the data dictionary section sectionObj, a Simulink.data.dictionary.Section object. If there are multiple entries with the specified name in a hierarchy of reference dictionaries, the function deletes all the entries. If you represent a data dictionary entry with one or more Simulink.data.dictionary.Entry objects and later delete the entry using the deleteEntry function, the objects remain with their Status property set to 'Deleted'.

deleteEntry(sectionObj,entryName,'DataSource',dictionaryName) deletes an entry that is defined in the data dictionary DictionaryName. Use this syntax to uniquely identify an entry that is defined more than once in a hierarchy of referenced data dictionaries.

Input Arguments

expand all

Target data dictionary section, specified as a Simulink.data.dictionary.Section object. Before you use this function, represent the target section with a Simulink.data.dictionary.Section object by using, for example, the getSection function.

Name of target data dictionary entry, specified as a character vector.

Example: 'myEntry'

Data Types: char

File name of data dictionary that defines the target entry, specified as a character vector including the .sldd extension.

Example: 'mySubDictionary_ex_API.sldd'

Data Types: char

Examples

expand all

Represent the Design Data section of the data dictionary myDictionary_ex_API.sldd with a Simulink.data.dictionary.Section object named dDataSectObj. The Design Data section of myDictionary_ex_API.sldd already contains an entry named fuelFlow.

myDictionaryObj = Simulink.data.dictionary.open('myDictionary_ex_API.sldd');
dDataSectObj = getSection(myDictionaryObj,'Design Data');

Delete the entry fuelFlow from the data dictionary myDictionary_ex_API.sldd. myDictionary_ex_API.sldd no longer contains the fuelFlow entry.

deleteEntry(dDataSectObj,'fuelFlow')

Represent the Design Data section of the data dictionary myDictionary_ex_API.sldd with a Simulink.data.dictionary.Section object named dDataSectObj.

myDictionaryObj = Simulink.data.dictionary.open('myDictionary_ex_API.sldd');
dDataSectObj = getSection(myDictionaryObj,'Design Data');

Delete the entry myRefEntry from the data dictionary myRefDictionary_ex_API.sldd. myDictionary_ex_API.sldd references myRefDictionary_ex_API.sldd, and myRefDictionary_ex_API.sldd defines an entrymyRefEntry.

deleteEntry(dDataSectObj,'myRefEntry','DataSource',...
'myRefDictionary_ex_API.sldd')

Alternatives

You can use the Model Explorer window to delete entries from a data dictionary in the same way you can delete variables from a model workspace or the base workspace.

Introduced in R2015a