필터 지우기
필터 지우기

out of scope timer or not saved to variable

조회 수: 3 (최근 30일)
Ali Omar
Ali Omar 2011년 8월 25일
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

채택된 답변

Paulo Silva
Paulo Silva 2011년 8월 25일
delete(timerfindall) %if you only have that timer
%timerfindall is a MATLAB function
  댓글 수: 2
Ali Omar
Ali Omar 2011년 8월 25일
that was fast, precise and did the trick..... thanx
Paulo Silva
Paulo Silva 2011년 8월 25일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by