Google Grup tidak lagi mendukung postingan atau langganan Usenet baru. Konten lama masih dapat dilihat.

How to start/Stop running simulink model from GUI?

367 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Ketan Chhaniyara

belum dibaca,
19 Jun 2009, 05.25.0319/06/09
kepada
I have made a GUI for controlling a robot.

In it there is one button 'Start' to run the simulink model integrated with it.

Now I want that by pressing 'Stop' button, running simulink model should get stop and close.

How to do it. Its urgent.

KK KK

belum dibaca,
19 Jun 2009, 05.43.0119/06/09
kepada
hi... check this it might b helpful...
http://blinkdagger.com/matlab/matlab-gui-tutorial-integrating-simulink-model-into-a-gui?

"Ketan Chhaniyara" <ketan.ch...@vvpedulink.ac.in> wrote in message <h1flhf$7g5$1...@fred.mathworks.com>...

Phil Goddard

belum dibaca,
19 Jun 2009, 11.20.1919/06/09
kepada

The given link is a good example of running a simulation over a given period of time (i.e. assuming you know the stop time in advance).
However if you want to start a model and run it until you press a stop button, then you need to use the commands
set_param('modelName','SimulationCommand','start');
and
set_param('modelName','SimulationCommand','stop');
as part of appropriate button callback routines.
Typically you would set the stop time to Inf so that the model runs infinitely (unless the stop button is pressed).

Search the doc for "SimulationCommand" and "SimulationStatus" to read more on how these commands work.

There are a number of examples which you can find doing an internet search, one would be
http://www.mathworks.com/matlabcentral/fileexchange/24294

Phil.

Ketan Chhaniyara

belum dibaca,
21 Jun 2009, 10.21.0121/06/09
kepada
Thank you.

"Phil Goddard" <philN...@goddardconsulting.ca> wrote in message <h1gabj$ntq$1...@fred.mathworks.com>...

0 pesan baru