How can I change a parameter in my simulation in the after sometime of the run time ?

1 次查看(过去 30 天)
I have simulation model that will be run for 5 sec. I want to run my simulation for 3 sec, then change some parameters in my model and pause the run to end the remind 2 sec. How can I do it by fast way? I know there is a step forward to do it for each step but I need faster way.

回答(1 个)

Urmila Rajpurohith
Urmila Rajpurohith 2020-5-22
To change the parameters in a model after x sec we need to pause the model when the Simulation time reaches to x sec
To do this we can use pause simulation using Assertion block Model in the top model
refer to the below documentation for how to create a pause simulation model using assertion block
In the Assertion block dialog box, clear the Stop simulation when assertion fails check box. Enter this command as the value of Simulation callback when assertion fails:
set_param(bdroot,'SimulationCommand','pause')
whenever the simulation time reaches to x sec it will pause the model and then user can change the parameters and continue the simulation.

类别

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