Code covered by the BSD License  

Highlights from
Classic watch

5.0

5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 1.96 KB File ID: #41389
image thumbnail

Classic watch

by

 

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   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
23 Jul 2013 Haim  
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