while loop simulink running
6 views (last 30 days)
Show older comments
Hello,
i have a simulink model and i want to run it in a while loop. For example:
The simulink model itself should run 10 s, after this a value should increment (c=c+1) and it should run again 10 s. This should happen till a certainly value for example for c appear.
Is it possible to make in Simulink?
My aim:
I want to write a script. This script schould call a simulink model in a while loop, till a value appear.
During the run the matlab script should get in live time certainly values from a channel in simulink (not after the simulink run is finish)!
If the value differ from the set value, the simulation should be stopped, the parameter increment and the run should appear again.
If a error appears, which call a pop up window. The simulink model should stop and the parameter should be incremented again. The simulink should run after it and so on.
Is it possible to make such a script?
How it could look like?
Thanks in advance!
0 Comments
Answers (1)
Jim Riggs
on 11 May 2018
for c=1:10
sim('SimulinkModelName')
end
This will run the specified Simulink model 10 times with c=1 to 10.
See Also
Categories
Find more on Simulink Environment Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!