findobj fails in timer call back
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Creating, Deleting, and Querying Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!