Is there a way to change my simulink parameters at a pre-set time during the simulation?

4 次查看(过去 30 天)
Currently I am running Simulink from a script which sets up some parameters for me which are used and considered constant during my simulink simulation. I want to now change a parameter while the simulation is running at some time t=Tswitch. Is there an easy way to do this, maybe by running a Matlab script during the simulink simulation?
Just to be more specific, I want to change an LTI model which I setup in my script to a different LTI model during running.

采纳的回答

Fangjun Jiang
Fangjun Jiang 2024-4-6
There are ways but you are looking for "an easy way".
Typically I would implement this in the model using the Step block. For example, if you want to change the Gain of a LTI system, then you can add a Product block. One input is the output of this LTI system, the other input is the output of this Step block. The before and after value, the timing can all be parameterized.
Whether it is practical depends on which parameter (or parameters) you are switching. You may have to implement this LTI system in different style.
If they are two completely different LTI systems or there are two many parameters to switch, you could use a Step block and a Switch block to switch the output of the two LTI systems.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by