while loop simulink running
Ältere Kommentare anzeigen
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!
Antworten (1)
Jim Riggs
am 11 Mai 2018
for c=1:10
sim('SimulinkModelName')
end
This will run the specified Simulink model 10 times with c=1 to 10.
1 Kommentar
Michael Simonovski
am 11 Jun. 2018
Kategorien
Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!