⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mymain.m

📁 经典控制理论MATLAB-GUI设计
💻 M
字号:

%显示初始界面
screen=get(0,'screensize');
winw=screen(3);winh=screen(4);

windface=figure('color',[0.9 0.9 0.9],'position',[0.2*winw,0.2*winh,0.6*winw,0.6*winh],...
       'name','《控制理论CAI》','numbertitle','off','menubar','none',...
        'resize','on');
    
%在面板上显示欢迎字幕,并设置其底色,color为颜色,pos为位置,show(pos,color,'填要出现的字'),
%pos[x, y, width, height],当位小数点是,表示占整个面板的百分比,比如,0.2,即占总面板的百分之20
color=[.9,.9,.9];
pos=[0.35,0.85,0.3,0.05];
showtext(pos,color,'欢迎使用'); 
pos=[0.21,0.8,0.6,0.05];
showtext(pos,color,'《控制理论计算机辅助教学软件包》');
pos=[0.35,0.75,0.3,0.05];
showtext(pos,color,'V1.0.1');
pos=[0.20,0.25,0.6,0.05];
showtext(pos,color,'设计者:侯晓栋');
pos=[0.20,0.20,0.6,0.05];
showtext(pos,color,'指导老师:李雅青');
pos=[0.20,0.04,0.6,0.05];
showtext(pos,color,'版权所有:中北大学分校机电工程系     (c)2005 ');


str=['close(windface);mymainmenu'];
uicontrol(windface,'style','push','string','Ok',...
       'position',[0.25,0.1,0.2,0.07],'units','normalized',...
      'callback',str,'fontsize',12);
uicontrol(windface,'style','push','string','About...',...
       'position',[0.55,0.1,0.2,0.07],'units','normalized',...
      'callback',' mycabout','fontsize',12);
%在面板上显示一个图形,是surf型的
[m,n]=meshgrid(-3:1/8:3);%meshigrid(产生"格点"矩阵),meshgrid(x,网格间距,y)
z=3*(1-m).^2.*exp(-(m.^2)-(n+1).^2)-10*(m/5-m.^3-n.^5).*exp(-m.^2-n.^2)-1/3*exp(-(m+1).^2-n.^2);
surf(m,n,z);
axis off; %将轴的显示关掉


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -