Code covered by the BSD License  

Highlights from
Classic watch

Be the first to rate this file! 37 Downloads (last 30 days) File Size: 1.96 KB File ID: #41389
image thumbnail

Classic watch

by Oren berkovicth

 

19 Apr 2013

Displays the analog clock and digital clock

| Watch this File

File Information
Description

Using a simple timer allows to build a beautiful watch.

Required Products MATLAB
MATLAB release MATLAB 7.12 (R2011a)
Tags for This File  
Everyone's Tags
gui, timer
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
22 Apr 2013 Jan Simon

I'd definitely omit the header "close all;
fig=figure(1);". It is not useful to close other figures from here and the hard-coded figure handle 1 is not secure. Better use an non-integer handle to avoid collisions with other figures.

Creating the display in each timer callback completely, it would take much less processing time to update only the changed elements. Simply store the handles of the created objects in the TIMER's UserData and update the XData and YData of the PATChas well as the String property of the text showing the current time.

Contact us