MATLAB: Out of scope timer or not saved to variable

delete timerMATLABnot assigned to variableout of scope

delete a timer that was not declared to a variable
start(timer('TimerFcn',@callbckfcn, 'StartDelay', 1, 'Period',5, 'ExecutionMode', 'fixedRate'));
delete a timer that was declared inside a function that has terminated
function fcn
t1 = timer('TimerFcn',@callbckfcn, 'StartDelay', 1, 'Period',5, 'ExecutionMode', 'fixedRate');
start(t1);
end

Best Answer

delete(timerfindall) %if you only have that timer
%timerfindall is a MATLAB function