MATLAB: Is there a way to flush any pending timer events till the timer stopfunction is getting executed

MATLAB

When I use a timer object, I see that the STOPFCN of the timer doesn't stop TIMERFCN from executing. Is it a way to prevent TIMERFCN from execution when the timer is stopped?

Best Answer

The ability to flush any pending timer events before the timer stopfunction is executed is not available in MATLAB.
There are no workarounds.