Simulink Reference | ![]() ![]() |
Set Simulink system and block parameters.
Syntax
Description
set_param('obj', 'parameter1', value1, 'parameter2', value2, ...)
, where 'obj'
is a system or block path or 0
, sets the specified parameters to the specified values. Use 0
to set the default value of a parameter or the values of session parameters. Case is ignored for parameter names. Value strings are case sensitive. Any parameters that correspond to dialog box entries have string values. Model and block parameters are listed in Appendix , "Model and Block Parameters.
You can change block parameter values in the workspace during a simulation and update the block diagram with these changes. To do this, make the changes in the command window, then make the model window the active window, then choose Update Diagram from the Edit menu.
Note
Most block parameter values must be specified as strings. Two exceptions are the Position and UserData parameters, common to all blocks.
|
Examples
This command sets the Solver
and StopTime
parameters of the vdp
system.
This command sets the Gain parameter of block Mu in the vdp
system to 1000 (stiff).
This command sets the position of the Fcn block in the vdp
system.
This command sets the Zeros
and Poles
parameters for the Zero-Pole block in the mymodel
system.
This command sets the Gain parameter for a block in a masked subsystem. The variable k
is associated with the Gain parameter.
This command sets the OpenFcn
callback parameter of the block named Compute
in system mymodel
. The function 'my_open_fcn'
executes when the user double-clicks on the Compute block (see Using Callback Routines).
See Also
![]() | save_system | simulink | ![]() |