Main Content

getEntry

Create Simulink.data.dictionary.Entry object to represent data dictionary entry

Description

entryObj = getEntry(sectionObj,entryName) returns an array of Simulink.data.dictionary.Entry objects representing data dictionary entries entryName found in the data dictionary section sectionObj, a Simulinkdata.dictionary.Section object. getEntry returns multiple objects if multiple entries have the specified name in a reference hierarchy of data dictionaries.

example

entryObj = getEntry(sectionObj,entryName,'DataSource',dictionaryName) returns an object representing a data dictionary 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.

example

Examples

collapse all

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');

Represent the data dictionary entry fuelFlow with a Simulink.data.dictionary.Entry object named fuelFlowObj. fuelFlow is defined in the data dictionary myDictionary_ex_API.sldd.

fuelFlowObj = getEntry(dDataSectObj,'fuelFlow');

Set the value of the entry fuelFlow to 493.

setValue(fuelFlowObj,493)

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');

Represent the data dictionary entry myRefEntry with a Simulink.data.dictionary.Entry object named refEntryObj. myDictionary_ex_API.sldd references myRefDictionary_ex_API.sldd, and myRefDictionary_ex_API.sldd defines an entry myRefEntry.

refEntryObj = getEntry(dDataSectObj,'myRefEntry','DataSource',...
'myRefDictionary_ex_API.sldd');

Set the value of the entry myRefEntry to 493.

setValue(refEntryObj,493)

Input Arguments

collapse 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 containing the target entry, specified as a character vector including the .sldd extension.

Example: 'mySubDictionary_ex_API.sldd'

Data Types: char

Output Arguments

collapse all

Target data dictionary entry, returned as one or more Simulink.data.dictionary.Entry objects.

Version History

Introduced in R2015a