Azzera filtri
Azzera filtri

control simulink from mfile

4 visualizzazioni (ultimi 30 giorni)
Matus
Matus il 25 Mar 2012
Hi, I would like to control simulink from m-file. I wrote m-file. I start simulation (from m-file) and then I need after some time to stop simulation and change some input parameters and then continue. Is it possible? I have been looking for information about that but I havent been successful. e.g. I have a model in simulink which contains voltage source and resistance. Simulation runs 10 seconds. I would like to change every second peak amplitude of voltage source. I could use e.g. programmable voltage source but I would like to do it by means of m-file. Thank you in andvance.

Risposta accettata

TAB
TAB il 26 Mar 2012
To start, stop, pause, and update your model from m-file you can use
set_param('YourModel', 'SimulationCommand', 'cmd');
Where cmd could be
start - To start simulation
stop - To stop simulation
pause - To puase simulation
continue - To continue from puase
update - To update the model
  6 Commenti
Matus
Matus il 26 Mar 2012
thank you, i will try
Matus
Matus il 29 Mar 2012
Thank you Kaustubha, it works great.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Simulink 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!

Translated by