Azzera filtri
Azzera filtri

out of scope timer or not saved to variable

3 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Paulo Silva
Paulo Silva il 25 Ago 2011
delete(timerfindall) %if you only have that timer
%timerfindall is a MATLAB function
  2 Commenti
Ali Omar
Ali Omar il 25 Ago 2011
that was fast, precise and did the trick..... thanx
Paulo Silva
Paulo Silva il 25 Ago 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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by