Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Error while evaluating TimerFcn for timer /Invalid or deleted object.
Replies: 2   Last Post: Jan 6, 2013 5:58 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Nima Nikvand

Posts: 11
Registered: 12/30/12
Error while evaluating TimerFcn for timer /Invalid or deleted object.
Posted: Jan 6, 2013 2:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello everyone,

I am using a timer in my GUI, and everything seems to be working alright. However after I close my GUI, I am receiving an error, which says:


"Error while evaluating TimerFcn for timer /Invalid or deleted object."

Here is my code for the timer which I run in OpeningFcn:

tmr = timer('Name','Reminder',...
'Period',0.1,... % Update the time every 60 seconds.
'TasksToExecute',inf,... % number of times to update
'ExecutionMode','fixedSpacing',...
'TimerFcn',{@update1,handles});
start(tmr);

and here is the update1:

function update1(hObject,eventdata,handles)
set(handles.text1,'string','');
pause(0.5);
set(handles.text1,'string',num2str(datestr(now)));
set(handles.text1,'Fontsize', 10, 'FontWeight', 'bold');
pause(0.5);


Also, I run a closing function as follows:
set(hObject, 'DeleteFcn', {@closefun,handles});
function closefun(hObject,eventdata,handles)

t = timerfindall;
if ~isempty(t)
stop(t);
delete(t);
clear t;
end
end


But even if I remove the closing function compeletly I still get that error upon closing the GUI. I appreciate any help.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.