Is there anyway to pause and start function with sim command? I writed in a loop "sim" command and it is working but video display is blinking cause of starting-stoping simulation again and again. That is working start-stop mechanism, i need start-pause mechanism =)
How to associate M-File and Simulink?
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have to execute physic system with codes in progressing with time. I did that in an M-File(coordinates is working) but the other system which is connected with physic system is in Simulink. I couldn't associate M-File in progressing with time and Simulink. May i did that with sim command setting parameters?
My purpose is drawing an object with Simulink but object's coordinates is changing with time and this parameters calculating with M-File. How can i do that? Thank you for the answers now, sorry for bad english =/
Risposte (1)
Wayne King
il 27 Dic 2011
Hi Ercin, You can use the MATLAB function block.
3 Commenti
Kaustubha Govind
il 29 Dic 2011
You can place the MATLAB Function block inside an Enabled Subsystem and control its execution using an enable signal.
The sim command only returns to MATLAB after the simulation is complete, so if you want to be able to pause simulation, you need to start simulation using set_param(bdroot,'SimulationCommand','start') so that control is immediately returned to MATLAB. You can then use the PAUSE command (say pause(5) if you want to run for 5secs) to let the model run for a short period, and then use set_param(bdroot,'SimulationCommand','pause') to pause simulation. Use set_param(bdroot,'SimulationCommand','stop') to stop simulation.
Vedere anche
Categorie
Scopri di più su General Applications in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!