findobj fails in timer call back
이전 댓글 표시
I was testing a timer in a large program written in GUIDE and I came across these strange results.
function checkfordone_openningFcn(hObject, eventdata, handles, varargin)
…
handles.t = timer(‘TimerFcn’,@IsDataReady,’ExecutionMode’,’fixedRate’,’Period,4);
start(handles.t)
function IsDataReady(timerObject, eventdata)
fHandles = findobj(‘type’,’figure’,’tag’,’figure1’)
end
The findobj command in the timer function callback, IsDataReady, returns a valid handle to figure1 the first time it is called. After that it only returns null.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!