Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

How to give control to GUI while GUI is executing simulink model in a for loop

Asked by Arun Badigannavar on 4 Jan 2013

,And wen i press start button i have given a control to execute the simulink model for 1000 seconds in real time,,now i want to stop my simulation started after 20 seconds,,,but i don ave control to my gui until m simulink model finishes

0 Comments

Arun Badigannavar

Tags

Products

2 Answers

Answer by Kaustubha Govind on 4 Jan 2013

Perhaps you can create a Pause block in your model?

1 Comment

Arun Badigannavar on 7 Jan 2013

I dont want to pause my simulink model,,any other way?

Kaustubha Govind
Answer by Anthony Poulin on 7 Jan 2013

Hy,

I don't really understand what you want to do but you can strat, stop or pause your model excution with this command lines.

    set_param('modelname', 'SimulationCommand','start');
    set_param('modelname', 'SimulationCommand','continue');
    set_param('modelname', 'SimulationCommand','pause');
    set_param('modelname', 'SimulationCommand','stop');

If you to stop the model after 20s of simulution you can use get_param('modelname', 'SimulationTime'); Or using the clock for stopping in real time...

3 Comments

Arun Badigannavar on 7 Jan 2013

Thanks for the response,,but my requirment is like i have to run and stop whenver i want using GUI

Kaustubha Govind on 7 Jan 2013

Arun: If you want to use GUI callbacks, you should use Poulin's suggested commands in those callbacks.

Arun Badigannavar on 11 Jan 2013

i am able to use it thanks

Anthony Poulin

Contact us