Matlab GUI编程参考中文文档

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

MatlabGUI||||||MatlabGUIGraphicalUserInterfacesGUIObjectsGUIMATLABdemoMATLABdemoMATLABGUIGUI“”234“”4GUIMMGUI5MATLAB5.xguide61011.1*11.1-1ABCD1clfresetH=axes('unit','normalized','position',[0,0,1,1],'visible','off');set(gcf,'currentaxes',H);str='\fontname{}';text(0.12,0.93,str,'fontsize',13);h_fig=get(H,'parent');set(h_fig,'unit','normalized','position',[0.1,0.2,0.7,0.4]);h_axes=axes('parent',h_fig,...'unit','normalized','position',[0.1,0.15,0.55,0.7],...'xlim',[015],'ylim',[01.8],'fontsize',8);file:////G|/Matlab/Matlab%20GUI.htm(1of17)2003-8-3119:36:26MatlabGUI11.1-12“”“”h_text=uicontrol(h_fig,'style','text',...'unit','normalized','position',[0.67,0.73,0.25,0.14],...'horizontal','left','string',{'','zeta='});h_edit=uicontrol(h_fig,'style','edit',...'unit','normalized','position',[0.67,0.59,0.25,0.14],...'horizontal','left',...'callback',[...'z=str2num(get(gcbo,''string''));',...'t=0:0.1:15;',...'fork=1:length(z);',...'s2=tf(1,[12*z(k)1]);',...'y(:,k)=step(s2,t);',...'plot(t,y(:,k));',...'if(length(z)1),holdon,end,',...'end;',...'holdoff,']);11.1-23h_push1=uicontrol(h_fig,'style','push',...'unit','normalized','position',[0.67,0.37,0.12,0.15],...'string','gridon','callback','gridon');h_push2=uicontrol(h_fig,'style','push',...'unit','normalized','position',[0.67,0.15,0.12,0.15],...'string','gridoff','callback','gridoff');11.1-3411.1-411.1-511.211.2.111.2.211.3uimenu11.3.111.3.1-11figure2set(H_fig,'MenuBar','none')file:////G|/Matlab/Matlab%20GUI.htm(2of17)2003-8-3119:36:26MatlabGUIset(gcf,'menubar',menubar);3set(gcf,'menubar','figure');11.3.1-111.3.1-211.3.2*11.3.2-111.3.2-1figure%h_menu=uimenu(gcf,'label','Color');%Color2h_submenu1=uimenu(h_menu,'label','Blue',...%Blue3'callback','set(gcf,''Color'',''blue'')');%4h_submenu2=uimenu(h_menu,'label','Red',...%Red5'callback','set(gcf,''Color'',''red'')');%611.3.2-111.3.311.3.3.1*11.3.3.1-1Test“”ABCuimenuD1MATLAB11.3.3.1-1gridon,set(gca,'box','on')11.3.3.1-12MATLABeval11.3.3.1-1eval('gridon,set(gca,''box'',''on'')')311.3.3.1-2uimenuuimenu('Label','Test','Callback','gridon,set(gca,''box'',''on''),')11.3.3.1-2Test411.3.3.1-2uimenuuimenu('Label','Test',...'Callback',['gridon,',...'set(gca,''box'',''on'');'])file:////G|/Matlab/Matlab%20GUI.htm(3of17)2003-8-3119:36:26MatlabGUI511.3.3.1-2uimenuLpv='Test';Cpv=['gridon,','set(gca,''box'',''on''),'];uimenu('Label',Lpv,'Callback',Cpv)611.3.3.1-2uimenuPS.Label='Test';PS.Callback=['gridon;','set(gca,''box'',''on'');'];uimenu(PS)11.3.3.2*11.3.3.2-111.3.2-111.3.3.2-1ColorBlueRed[exm11332_1.m]figureh_menu=uimenu(gcf,'Label','&Color');%CColor2h_submenu1=uimenu(h_menu,'Label','&Blue',...%BBlue3'Callback','set(gcf,''color'',''blue'')');h_submenu2=uimenu(h_menu,'label','Red',...%Red'Callback','set(gcf,''color'',''red'')',...'Accelerator','r');%RedR711.3.3.2-111.3.3.3*11.3.3.3-1'Option'11.3.3.3-1[exm11333_1.m]figureh_menu=uimenu('label','Option','Position',3);h_sub1=uimenu(h_menu,'label','gridon','callback','gridon');h_sub2=uimenu(h_menu,'label','gridoff','callback','gridon');h_sub3=uimenu(h_menu,'label','boxon','callback','boxon',...'separator','on');%6h_sub4=uimenu(h_menu,'label','boxoff','callback','boxoff');h_sub5=uimenu(h_menu,'label','FigureColor','Separator','on');%8h_subsub1=uimenu(h_sub5,'label','Red','ForeGroundColor','r',...%9'callback','set(gcf,''Color'',''r'')');h_subsub2=uimenu(h_sub5,'label','Reset',...'callback','set(gcf,''Color'',''w'')');11.3.3.3-1Pos_O=get(h_menu,'position'),%Optionfile:////G|/Matlab/Matlab%20GUI.htm(4of17)2003-8-3119:36:26MatlabGUIPos_BoxOn=get(h_sub3,'position')%boxobPos_Red=get(h_subsub1,'position')%redPos_O=3Pos_BoxOn=3Pos_Red=1*11.3.3.3-2“√”[exm11333_2.m]figureh_menu=uimenu('label','Option');h_sub1=uimenu(h_menu,'label','Gridon',...%3'callback',[...'gridon,',...'set(h_sub1,''checked'',''on''),',...'set(h_sub2,''checked'',''off''),',...]);h_sub2=uimenu(h_menu,'label','Gridoff',...%4'callback',[...'gridoff,',...'set(h_sub2,''checked'',''on''),',...'set(h_sub1,''checked'',''off''),',...]);11.3.3.3-2Gridon11.3.3.4EnableVisible*11.3.3.4-11Mexm11334_1.m[exm11334_1.m]clfh_menu=uimenu('label','Option');%Optionh_sub1=uimenu(h_menu,'label','Axison');%Axisonh_sub2=uimenu(h_menu,'label','Axisoff',...'enable','off');%Axisoffh_sub3=uimenu(h_menu,'label','Gridon',...'separator','on','visible','off');%Gridonh_sub4=uimenu(h_menu,'label','Gridoff',...'visible','off');%Gridoffset(h_sub1,'callback',[...%Axison'Axison,',...%'set(h_sub1,''enable'',''off''),',...%Axison'set(h_sub2,''enable'',''on''),',...%Axisofffile:////G|/Matlab/Matlab%20GUI.htm(5of17)2003-8-3119:36:26MatlabGUI'set(h_sub3,''visible'',''on''),',...%Gridon'set(h_sub4,''visible'',''on''),']);%Gridoffset(h_sub2,'callback',[...%%Axisoff'axisoff,',...%'set(h_sub1,''enable'',''on''),',...%Axison'set(h_sub2,''enable'',''off''),',...%Axisoff'set(h_sub3,''visible'',''off''),',...%Gridon'set(h_sub4,''visible'',''off''),']);%Gridoffset(h_sub3,'callback',[...%Gridon'gridon,',...%'set(h_sub3,''enable'',''off''),',...%Gridon'set(h_sub4,''

1 / 17
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功