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

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

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.

its good,i wanted know much detail will u explain

Dear Naveen, all the required information regarding this project is already present within the article.

i want the source code of it.but it is not downloaded

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.

Really super & more and more project how to I am subscribes

Kindly elaborate your query.

i want english code

thanks a lot

code is not showing kindly mail me at:

[email protected]

Plž send me a souřce code

[email protected]

The source code is present within the article.

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???

Is it possible to have more explanations about the code please ?

Hi, I’m having trouble viewing the source code in MATLAB, how would I do this?

Kindly refresh the page and redownload.

Can u plz send source code to mail id: [email protected].

I

It’s getting prblm while downloading

Hi Vyshnavi, could you please explain the problem in detail?

can we have matlab code for this Please

sir could you please send me a source code

[email protected]

Hi Asha, the source code can be downloaded from the end of the article.