Documentation

Variables

Assign variable values using model workspace, symbols, data objects, and data classes

You can use MATLAB® variables to configure and manage signals and block parameters in a model. For more information about how models use variables, see Symbol Resolution.

You can store model variables in the MATLAB base workspace, a model workspace, or a data dictionary. To decide where to store variables for your model, see Determine Where to Store Data for Simulink Models.

To use variables to control signal and parameter characteristics, such as data types and code generation settings, you can store data objects in a workspace or data dictionary. See Data Objects.

Functions

Manage Variables

getVariable Get value of variable from workspace
hasVariable Determine if variable exists in workspace
Simulink.findVars Find variables in models and blocks
matlab.io.saveVariablesToScript Save workspace variables to MATLAB script
Simulink.data.evalinGlobal Evaluate MATLAB expression in context of Simulink model
Simulink.data.assigninGlobal Modify variable values in context of Simulink model
Simulink.data.existsInGlobal Check existence of variable in context of Simulink model

Data Dictionary

Simulink.data.dictionary.create Create new data dictionary and create Simulink.data.Dictionary object
Simulink.data.dictionary.open Open data dictionary for editing
Simulink.data.dictionary.cleanupWorkerCache Restore defaults after parallel simulation with data dictionary
Simulink.data.dictionary.setupWorkerCache Enable parallel simulation with data dictionary
Simulink.data.dictionary.getOpenDictionaryPaths Return file names and paths of open data dictionaries
Simulink.data.dictionary.closeAll Close all connections to all open data dictionaries

Classes

Simulink.ModelWorkspace Describe model workspace
Simulink.WorkspaceVar Contains information about workspace variables and blocks that use them
Simulink.VariableUsage Get information about workspace variables and blocks that use them
Simulink.CoderInfo Specify information needed to generate code for signal or parameter
Simulink.data.Dictionary Configure data dictionary
Simulink.data.dictionary.Section Configure data dictionary section
Simulink.data.dictionary.Entry Configure data dictionary entry
Simulink.data.dictionary.EnumTypeDefinition Store enumerated type definition in data dictionary

Related Information

Was this topic helpful?