findobj fails in timer call back
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!