Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Matlab GUI with timer in the background

Subject: Matlab GUI with timer in the background

From: Nima Nikvand

Date: 6 Jan, 2013 05:17:08

Message: 1 of 1

Hello everyone,

I have a GUI (developed using guide) and I need to show the current time and date in one of its corners, I have written a simple code which works alright, however I am not sure where in the GUI code to use it. When I use the code in GUI_OpeningFcn, which executes just before gui is made visible, it shows the time but MATLAB remains busy and I won't be able to run anything else from the command window, furthermore, I am not sure how to stop the timer and delete the timer when the GUI is closed. When I use handles to save timer created in OpeningFcn and later delete the timer in OutputFcn, I get an error saying my handle is invalid! The code is posted below and I appreciate any help with this.



function timexup(obj,event,handles)
set(handles.text6,'Fontsize', 10, 'FontWeight', 'bold');

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us