Reply by mafgani October 26, 20092009-10-26
>Hi, > >I have a question as to whether one can programmatically control Matlab >event loop? > >First, is there a way to stop or pause Matlab execution via an >automated command, or via a button press. I know that upon execution of >pause(), redraw() etc functions, Matlab will check its event queue and >execute pending items in that queue. However, those commands have to be >explicitly inserted into the Matlab code. Is there a way to make Matlab >respond to user interrupt (button press? or the like?)
You might want to check out the following: http://scrolls.mafgani.net/2007/03/matlab-interrupting-function-execution/ Cheers, Mostafa
Reply by Stan Pawlukiewicz July 13, 20052005-07-13
Patrycja wrote:
> Hi, > > I have a question as to whether one can programmatically control Matlab > event loop? > > First, is there a way to stop or pause Matlab execution via an > automated command, or via a button press. I know that upon execution of > pause(), redraw() etc functions, Matlab will check its event queue and > execute pending items in that queue. However, those commands have to be > explicitly inserted into the Matlab code. Is there a way to make Matlab > respond to user interrupt (button press? or the like?) > > Second, given that the only way to do this is to put pause()/redraw() > etc into Matlab, how does one add things to the event queue. For > example, if I am starting Matlab engine from C, and then run a long > calculation in Matlab, and put a pause() inside matlab routine, how can > I add things to the event queue? ... by calling evalString() or similar > from C. Could that add things to the event queue to be executed by > Matlab when it reaches pause() statement? > > Any help appreciated, > > patrycja >
This is one of those issues where matlab behavior depends on the OS you happen to be running. Actually I think its more of an X11 vs windows sort of issue.
Reply by Patrycja July 12, 20052005-07-12
Hi,

I have a question as to whether one can programmatically control Matlab
event loop?

First, is there a way to stop or pause Matlab execution via an
automated command, or via a button press. I know that upon execution of
pause(), redraw() etc functions, Matlab will check its event queue and
execute pending items in that queue. However, those commands have to be
explicitly inserted into the Matlab code. Is there a way to make Matlab
respond to user interrupt (button press? or the like?)

Second, given that the only way to do this is to put pause()/redraw()
etc into Matlab, how does one add things to the event queue. For
example, if I am starting Matlab engine from C, and then run a long
calculation in Matlab, and put a pause() inside matlab routine, how can
I add things to the event queue? ... by calling evalString() or similar
from C. Could that add things to the event queue to be executed by
Matlab when it reaches pause() statement?

Any help appreciated,

patrycja