Simulink.VariableUsage
Store information about the relationship between variables and blocks in models
Description
A Simulink.VariableUsage
object describes
where a variable is used in models.
Use this information to:
Prepare to permanently store the variables in files and workspaces. For more information about storing variables for a model, see Determine Where to Store Variables and Objects for Simulink Models.
Reduce the number of variables that you need to store by eliminating unused variables.
Prepare to partition variables and establish variable ownership when you work in a team.
To analyze variable usage in models, use Simulink.VariableUsage
objects together with the
Simulink.findVars
function. The function returns and accepts
Simulink.VariableUsage
objects as arguments. For
more information, see Simulink.findVars
.
A Simulink.VariableUsage
object can also describe
the usage of an enumerated data type.
Only a Simulink.VariableUsage
constructor or the Simulink.findVars
function can set property values in a
Simulink.VariableUsage
object. The properties are otherwise read
only.
Creation
The Simulink.findVars
function returns
Simulink.VariableUsage
objects.
To create variable usage objects for use as a filter when using
Simulink.findVars
, use the
Simulink.VariableUsage
function described below.
Description
variableUsageObj = Simulink.VariableUsage(
creates an array of varNames
,sourceName
)Simulink.VariableUsage
objects to
describe the variables varNames
. The constructor sets the
Name
property of each object to one of the variable names
specified by varNames
, and sets the Source
property of all the objects to the source specified by
sourceName
. You can specify varNames
with variables that are not used in any loaded models.
Input Arguments
Properties
Examples
Version History
Introduced in R2012b