Analogue Clock Using MATLAB

P. Manickaraja. He is masters in engineering in control and instrumentation from College of Engineering, Guindy, Tamil Nadu

44436
Advertisement

NASA might get a fancy digital-count display and retire the analogue clock from Apollo era but the passion for the analogue clock does not end. An analogue clock has moving hands, where the smaller one is the hours hand and travels 30° in one hour, and the longer one is the minutes hand and travels 360° in an hour. The seconds hand rotates with a step of 6°. Here we look to design an analogue clock using MATLAB.

Analogue clock using MATLAB: Screenshot of the program output
Screenshot of the program output

Analogue clock using MATLAB

The coding is developed using MATLAB version 7.9.0.529 (or R2009b). MATLAB has a good collection of graphics commands for plotting and analysing complex signals. The built-in functions reduce the size of the program and provide the desired output.

Program logic

Circle with a radius of 10 units is drawn. Hours are marked from 1 to 12, 30° apart. System time such as your PC’s is read by the command. According to the current time of your PC, the hours, minutes and seconds hands are displayed.

Download source code: click here

Commands used

Advertisement

The figure shows the screenshot of the program output. Commands used in the program for the analogue clock display are given below:
clock( ). This command extracts date, year and current time from the real-time system.
pause ( ). It provides the required time delay in seconds.
clc( ). It clears the command window.
clear( ). It clears all variables.
textxy ( ). This command prints the text in the specified location, which is mentioned as x and y coordinates.
numtostr( ). It converts a number to string data type.


Feel interested? Check out other matlab projects.

Advertisement


15 COMMENTS

    • Hi Ferdoos, Please refresh the page or check your interne connection. We have checked from our side and there is no problem in downloading the source file.

  1. What are the applications of analog clock using matlab????If we simulate analog clock using matlab, where it could be used???why can’t we do this in c or c++???Is there any special in matlab???

SHARE YOUR THOUGHTS & COMMENTS

Please enter your comment!
Please enter your name here