set
Description
set(
assigns values to variables in the connected data source.connectionObj
, varNames
, varValues
)
If the data connection can see multiple definitions of the same variable (for example, in a data dictionary and in a referenced dictionary), the function updates the value for all definitions of the variable. If the variable does not exist in a data source visible to the data connection, then the function creates the variable in the directly connected data source.
Examples
Input Arguments
Tips
You can also read and assign values to variables by using the .
operator. For example, to read a variable from a data
dictionary:
dc_dd = Simulink.data.connect('myDictionary.sldd')
dc_dd.x = 1;
dc_dd.x
ans = 1
Version History
Introduced in R2024a