Using Simulink    
set_param

Set Simulink system and block parameters.

Syntax

Description

set_param('obj', 'parameter1', value1, 'parameter2', value2, ...), where 'obj' is a system or block path, sets the specified parameters to the specified values. 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 A.

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.

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. For more information, see Using Callback Routines.

See Also


 save_system simulink