Say I’ve got a function that evaluates to:
function test_timer()
a = timer ;
set(a, 'executionMode', 'fixedRate','TimerFcn','disp(rand)')
start(a)
end
..and I’ve accidentally left out ‘stop(a)’ within the function’s clause.
How do you stop the timer object (or all timer objects) from running without closing MATLAB using the command window?
You can use
timerfindto find the timers you would like to stop.Like this:
You can basically search any property you can define in timer function.
EDIT: You can use the
deletefunction to delete the timers.Let’s create a couple of timers to find and delete them: