Is there a way to abort Simulink simulation programatically if it takes a long time?
57 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a model that, depending on some variable values sometimes runs very slowly. Typically I try out many different variable values in a loop, i.e. I start the simulation from a MATLAB script. Is there a way to abort the simulation without breaking the loop if the simulation takes too long?
0 comentarios
Respuesta aceptada
Rob Graessle
el 25 de En. de 2011
Walter is correct about using a timer object that is configured to fire at the end of the wait period. In the timer callback you can use the following command to stop the simulation:
set_param('ModelName', 'SimulationCommand', 'stop')
where ModelName is the name of the model you are simulating.
Más respuestas (2)
Walter Roberson
el 25 de En. de 2011
In the MATLAB routine you could start a timer that would fire at the end of your wait. In the timer callback, you would instruct the simulation to stop.
I do not know the details at all, as I have not used simulink. It might involve setting a parameter and using a STOP block; see a recent cssm post
0 comentarios
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!