资源描述:
《mc-2000d型涂(镀)层测厚仪说明书》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、程序%%===主程序时钟程序======%%===clock1.m(注意使用原始文件名)======function[]=clock1()trycloseall%%===createthefigure============h0=figure('MenuBar','none',...'Color','white',...'NumberTitle','off',...'Name','Clock');%%===背景程序,不用可以删==========%ha=axes('units','normalized','position',[0011]);%uistack(ha,'down')
2、%II=imread('3.jpg');%===3.jpg是图片地址====%image(II)%colormapgray%set(ha,'handlevisibility','off','visible','off');%%===createamenutosetthetimingclock=====regular_t=uimenu('Parent',h0,...'Label','闹钟',...'Callback',@timing);%===调用了timing.m====%%===createamenutocalculatethetime=====cal_t=uimenu('Pa
3、rent',h0,...'Label','计时',...'Callback',['runcalc_time;']);%===运行了calc_time.m文件%%=================theta=linspace(0,6.288,1000);%6.28近似等于2*pix1=8*cos(theta);y1=8*sin(theta);plot(x1,y1,'color',[0.50.50.5],'linewidth',16)%===时钟的外层holdonaxisequal12fill(x1,y1,[0.70.70.7]);%===时钟的内层text(0,5,'thebigb
4、ag','fontsize',16,'color',[0.80.80.8],'HorizontalAlignment','center');%thenameoftheclocklightingphongmaterialmetalaxisoffaxis([-1010-1010])set(gca,'position',[0.10.10.7750.815]);%%===========================t_title=floor(clock);title([num2str(t_title(1))'年'num2str(t_title(2))'月'num2str(t_titl
5、e(3))'日'],'fontname','Verdana','fontsize',13,'color',[0.20.20.2]);%%===创建一个edit控件去显示数字时间=========h0_edit=uicontrol('parent',h0,...%aedittoshowthehour,minute,seconddymaically'enable','inactive',...'BackgroundColor',[10.80.4],...'fontname','Verdana',...'fontsize',12,...'style','edit',...'horizo
6、ntal','center',...'units','normalized','position',[0.380.040.220.08],...'string',[num2str(t_title(4))':'num2str(t_title(5))':'num2str(t_title(6))]);fork=1:12xk=8.8*cos(-2*pi/12*k+pi/2);yk=8.8*sin(-2*pi/12*k+pi/2);plot([xk/9*8xk/9*7],[yk/9*8yk/9*7],'color',[0.80.80.8],'linewidth',3);%text(xk,y
7、k,num2str(k),'fontsize',16,'color',[0.90.30.8],'HorizontalAlignment','center');%markofclockend12%%==========================ti=clock;%getthecurrenttime%%===时针初始位置===========th_out=-(ti(4)+ti(5)/60+ti(6)/3600)/12*2*pi+pi/2;%theangleofclockisdi