MATLABGUI¾¾GUI)UimenuUicontrolGetSetHd=figure(‘color’,’white’)H=figureGet(H)BackingStore=onCloseRequestFcn=closereqColor=[0.80.80.8]Colormap=[(64by3)doublearray]CurrentAxes=[]CurrentCharacter=CurrentObject=[]CurrentPoint=[00]Dithermap=[(64by3)doublearray]DithermapMode=manualFixedColors=[(3by3)doublearray]IntegerHandle=onInvertHardcopy=onKeyPressFcn=MenuBar=figureMinColormap=[64]Name=NextPlot=addNumberTitle=onPaperUnits=inchesPaperOrientation=portraitPaperPosition=[0.252.586]PaperPositionMode=manualPaperSize=[8.511]PaperType=usletterPointer=arrowPointerShapeCData=[(16by16)doublearray]PointerShapeHotSpot=[11]Position=[6436672504]Renderer=paintersRendererMode=autoResize=onResizeFcn=SelectionType=normalShareColors=onUnits=pixelsWindowButtonDownFcn=WindowButtonMotionFcn=WindowButtonUpFcn=WindowStyle=normalButtonDownFcn=Children=[]Clipping=onCreateFcn=DeleteFcn=BusyAction=queueHandleVisibility=onHitTest=onInterruptible=onParent=[0]Selected=offSelectionHighlight=onTag=Type=figureUIContextMenu=[]UserData=[]Visible=onh=plot(x,y,x,z)Æh(1)h(2)Set(h(1),’color’,[10.30.5],’linewidth’,3)Set(h(2),’color’,[10.50.5],’linewidth’,4)(H1=gcfgetcurrentfiguregcfforshort)H2=gcagetcurrentaxis(gca)H3=gco;getcurrentobject(gco)Get(H1,’type’)Get(H2,’type’)Get(0)……H=FindobjFindobj(‘Property’,PropertyValue)position)(units)Units:inches;centimetersPositionÆScreenSize[left,bottom]Æ[1,1][width,height]Æget(0,'screensize')ans=11800600(GUI)GraphicsUserInterfaceGUIUimenuUicontrolhm1=uimenu(h_parent,’property’,propertyvalue)Label:CallbackMatlabevalH1=uimenu(gcf,’label’,’example’)H1_1=uimenu(H1,’label’,’grid’,’callback’,’grid’)H1_2=uimenu(H1,’label’,’view’)H1_21=uimenu(H1_2,’label’,’2-D’,’callback’,’view(2)’)H1_22=uimenu(H1_2,’label’,’3-D’,’callback’,’view(3)’)H1_1H1_21H1_22H1_2H11.open,close)2.013.4.5.6.7.8.FrameH_box=uicontrol(gcf,’style’,’check’,…‘position’,[1005010020],…‘string’,’AxisBox’,…‘callback’,[‘ifget(H_box,’value’)==1’,…‘set(gca,’box’,’on’)’,…else…‘set(gca,’box’,’off’)’,…end])hm1=uicontrol(h_parent,’style’,’stylevalue’,’property’,propertyvalue)Style:CallbackMatlabevalGUIMatlab¾Guide¾¾GUIGUI设计GUI设计原则z易用性(简洁、直接、清晰)z统一性(表现形式统一,如字体、颜色等)z规范性(规范,-易用)z合理性(感觉协调、舒适)GUI设计步骤z需求分析z功能分析z设计检验z代码编写z程序调试GUI的实现z组件的布局z属性的编辑z回调函数通用函数functionRun_Draw(Fig_UserData,isYnHold)iflength(Fig_UserData)~=7ErrorDlg('输入参数不符合长度要求')return;endswitchFig_UserData(2)case1str1='-';case2str1='--';case3str1=':';case4str1='-.'otherwisestr1='-';End…listbox1_Callback(回调函数举例)functionlistbox1_Callback(hObject,eventdata,handles)%hObjecthandletolistbox1(seeGCBO)%eventdatareserved-tobedefinedinafutureversionofMATLAB%handlesstructurewithhandlesanduserdata(seeGUIDATA)%Hints:contents=get(hObject,'String')returnslistbox1contentsascellarray%contents{get(hObject,'Value')}returnsselecteditemfromlistbox1num=get(gcbo,'Value');Fig_UserData=get(gcf,'UserData');Fig_UserData(1)=num;set(gcf,'UserData',Fig_UserData);isYnHold=get(findobj(gcf,'Tag','Checkbox3'),'Value');Run_Draw(Fig_UserData,isYnHold);