Borrar filtros
Borrar filtros

out of scope timer or not saved to variable

1 visualización (últimos 30 días)
Ali Omar
Ali Omar el 25 de Ag. de 2011
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

Respuesta aceptada

Paulo Silva
Paulo Silva el 25 de Ag. de 2011
delete(timerfindall) %if you only have that timer
%timerfindall is a MATLAB function
  2 comentarios
Ali Omar
Ali Omar el 25 de Ag. de 2011
that was fast, precise and did the trick..... thanx
Paulo Silva
Paulo Silva el 25 de Ag. de 2011
You can also create timers with something in their Tag property and find them with timerfind
timer('TimerFcn','disp(1)', 'StartDelay', 1,...
'Period',5, 'ExecutionMode', 'fixedRate','Tag','MyTimer')
%just in case it's running (no warnings using the delete function)
stop(timerfind('Tag','MyTimer'))
delete(timerfind('Tag','MyTimer')) %it's stopped so you can now delete it

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by