set_param () function and the function is defined

1 Overview

And a module setting system parameters.

2, Syntax

set_param (Object, ParameterName, Value, ... ParameterNameN, ValueN)% on the specified model parameters module or object to the specified value.

When a plurality of the same parameter model or a module using a plurality set_param ParameterName-Value command and arguments to the group, instead of using multiple set_param command. This method is very efficient, because the use of a call can be computed once parameters. If any parameter name or value is invalid, the function does not set any parameters.

Tips :

If you call set_param multiple times for the same module, then use the value specified module handles more efficient than using the full path of the module. Use getSimulinkBlockHandle acquisition module handle.

If you use matlab -nodisplay start a session, you can not run the simulation set_param use. -nodisplay mode does not support the use of set_param simulation. Instead, use the sim command.

After setting the parameters in MATLAB® workspace, to view the changes in the model, update the graphics.

set_param(model,‘SimulationCommand’,‘Update’)

3, an example of

With set_param () function sets the parameters Gain module.

set_param(‘Demo/Subsystem1/Gain1’,‘Gain’,‘2’,‘SampleTime’,‘0.1’)

(Demo the Gain parameter model Subsystem1 Gain1 module subsystem to 2, the sampling time is set to 0.1.)

set_param(‘Demo’,‘Solver’,‘ode15s’,‘StopeTime’,‘300’)

(The Demo model solver is set to ode15s, the end of the simulation time is set to 300.)

发布了1 篇原创文章 · 获赞 0 · 访问量 56

Guess you like

Origin blog.csdn.net/qq_44249952/article/details/104075710