Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

how to enter data to a simulink model while it is executing

1 vue (au cours des 30 derniers jours)
Arun Badigannavar
Arun Badigannavar le 10 Déc 2012
Clôturé : MATLAB Answer Bot le 20 Août 2021
I am running my simulink models from gui written in script in MATLAB ,Now i want to change some values of simulink model blocks which are user entering while the starting of the simulation,,but now i want to change them whenever user wants them to change,,,for this i should pause the simualtion or how will i allow user to enter his value at any time

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 10 Déc 2012
If you don't need to change parameters while your model is running, it's better to stop your model. then use set_param function to change your parameters
  4 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 10 Déc 2012
Modifié(e) : Azzi Abdelmalek le 10 Déc 2012
use these commands
set_param('modelname','SimulationCommand','pause')
Then
set_param('modelname/yourblock','param','value')
then
set_param('modelname','SimulationCommand','continue')
If you want to stop simulation use
set_param('ansm269','SimulationCommand','stop')
doc set_param
Arun Badigannavar
Arun Badigannavar le 10 Déc 2012
Thanks @Azzi

Cette question est clôturée.

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by