set_param
Set Simulink parameter value
Description
set_param(
sets the specified Simulink® parameter object
,parameter
1,value
1,...,parameterN,valueN)parameter
to the specified value
value
for the target object specified by object
.
The target object can be a model, subsystem, library, block, line, port, or bus element port
element.
To set multiple parameter values for the target object, call the
set_param
function once with multiple name-value arguments instead of
separately calling the function for each parameter. Setting multiple parameters with one
function call is efficient because one call evaluates the parameters only once. If any
parameter names or values are invalid, then the function does not set any parameters.
Examples
Input Arguments
Limitations
If you use matlab -nodisplay
to start a session, you cannot use
set_param
to run a simulation. The -nodisplay
mode
does not support simulation using set_param
. Use the sim
function instead.
Tips
After you set parameters in the MATLAB workspace, to see the changes in a model, update the diagram.
set_param(model,'SimulationCommand','Update')
Version History
Introduced before R2006a
See Also
Functions
get_param
|getSimulinkBlockHandle
|gcs
|gcb
|bdroot
|open_system
|new_system