Can a timer fire during another timer callback?

I have two timers working simultaneously. The first timer starts every 1 second and takes 0.2 seconds to start. The second timer starts every 20 minutes and takes 5 minutes. I would like the first timer to continue to run for 5 minutes when the second timer executes its callback. In practice, during the second timer callback, the first timer does not start. Is it possible to configure timers to execute the way I want?

+3
source share
1 answer

There is a workaround, depending on how the timer callbacks are structured. If the long timer callback works with a long cycle or sequence of calls with various functions, you can insert calls drawnow()or pause(0.01), so that they are inferior to the Matlab message queue, which will handle pending graphics and timer events, including your other timer.

, , , . Matlab M-. Matlab , , , , , drawnow(), pause(), uiwait() . , Matlab, . Matlab . ( , , - .) , . BusyMode .

, , , , . ( , , .)

, drawnow, Matlab , .

+1

All Articles