Main Content


Set value of data dictionary entry



setValue(entryObj,newValue) assigns the value newValue to the data dictionary entry entryObj, a object.

To programmatically access variables for the purpose of sweeping block parameter values, consider using Simulink.SimulationInput objects instead of modifying the variables through the programmatic interface of the data dictionary. See Optimize, Estimate, and Sweep Block Parameter Values.


collapse all

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

myDictionaryObj ='myDictionary_ex_API.sldd');
dDataSectObj = getSection(myDictionaryObj,'Design Data');
fuelFlowObj = getEntry(dDataSectObj,'fuelFlow');

Set the value of the entry fuelFlow to 493. Then, view the Value property of fuelFlowObj to observe the change.

fuelFlowObj = 

  Entry with properties:

              Name: 'fuelFlow'
             Value: 493
        DataSource: 'myDictionary_ex_API.sldd'
      LastModified: '2014-Sep-05 13:37:22.161124'
    LastModifiedBy: 'jsmith'
            Status: 'Modified'

Input Arguments

collapse all

Target data dictionary entry, specified as a object. Before you use this function, represent the target entry with a object by using, for example, the getEntry function.

Value to assign to data dictionary entry, specified as a MATLAB expression. The expression must return a value that is supported by the data dictionary section that contains the entry.

Example: 27.5

Example: myBaseWorkspaceVariable

Example: Simulink.Parameter


You can use the Model Explorer window to view and change the values of data dictionary entries.

Introduced in R2015a