Main Content



Evaluate MATLAB expression in data dictionary section


returnValue = evalin(sectionObj,expression)


returnValue = evalin(sectionObj,expression) evaluates a MATLAB expression in the data dictionary section sectionObj and returns the values returned by expression.

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.

Input Arguments

expand all

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

MATLAB expression to evaluate, specified as a character vector.

Example: 'a = 5.3'

Example: 'whos'

Example: 'CurrentSpeed.Value = 290.73'

Data Types: char


expand all

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

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

Execute the whos command in the Design Data section of myDictionary_ex_API.sldd.

   Name                 Size            Bytes  Class                 Attributes

  fuelFlow             1x1                 8  double                          
  myRefEntry           1x1                 1  logical                         
  parameterGain37      1x1               112  Simulink.Parameter              


  • evalin allows you to treat a data dictionary section as a MATLAB workspace. You can think of entries contained in the section as workspace variables you can manipulate with MATLAB expressions.

Introduced in R2015a