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.

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.

You can store model variables in the MATLAB base workspace, a model workspace, or a data dictionary. To store local variables with a model, see Model Workspaces. To separate and scope variables into portable data dictionaries, see What Is a Data Dictionary?

Functions

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
set_param Set system and block parameter values
get_param Get parameter names and values
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.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
Simulink.data.dictionary.cleanupWorkerCache Restore defaults after parallel simulation with data dictionary
Simulink.data.dictionary.setupWorkerCache Enable parallel simulation with data dictionary

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.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?