A list,

Based on matlab clock design

Ii. Source code

function timeCompass(a)
%h_comaps H_compass = axes([x1;x2;x2],[y1;y2;y3]) %x1y1 x2y2 x3y3'visible'.'off'.'DrawMode'.'fast'); HAxesDot = axes('Visible'.'off'.'DrawMode'.'fast');
axis equal;
line(0.0.'Parent',hAxesDot,'Marker'.'o'.'MarkerFaceColor'.'k'.'MarkerSize'.15)

 try
  while 1%% Gets the current time =floor(clock); % round down clock: returns the current time and date to a (6Array of elements. hour = time(4);      % 2008    8    26    12     31    32.75
      min = time(5);
      sec = time(6);
      %fprintf(hour);
      argHour = pi/2 - (hour + min / 60) * pi / 6;
      argMin = pi/2 - (min + sec / 60) * pi / 30;
      argSec = pi/2 -sec * pi/30; HCompass = compass(hAxes,[0.5*cos(argHour);0.8*cos(argMin);cos(argSec)],[0.5*sin(argHour);0.8*sin(argMin);sin(argSec)]);
      set(hCompass,'LineWidth'.3); % Sets the line widthset(hCompass(3),'LineWidth'.1); % Sets the line widthset(hCompass(1),'Color'.'k'); % clockwise redset(hCompass(2),'Color'.'k');
      delete(findall(hAxes,'Type'.'text'.'-or'.'linestyle'.':')); %% Draws the value ang = PI /3 ;
     for i=1:12
         if rem(i,3) %3D multiple type12
            text(0.8*cos(ang),0.8*sin(ang),num2str(i),'horizontalAlignment'.'center'.'FontSize'.12.'Parent',hAxes);
         else
            text(0.8*cos(ang),0.8*sin(ang),num2str(i),'horizontalAlignment'.'center'.'FontSize'.20.'FontWeight'.'bold'.'Color'.'g'.'Parent',hAxes);
         end  
         ang =ang -pi/6;
     end
Copy the code

3. Operation results

Fourth, note

Version: 2014 a