资源描述:
《Al Ashi R.Y., Al Ameri A. Introduction to Graphical User Interface MATLAB 6.5 (UAE University)(en)(35s)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、IntroductiontoGraphicalUserInterface(GUI)MATLAB6.5UAEUNIVERSITYCOLLEGEOFENGINEERINGELECTRICALENGINEERINGDEPARTMENTIEEEUAEUSTUDENTBRANCHIntroductiontoGraphicalUserInterface(GUI)MATLAB6.5PresentedBy:RefaatYousefAlAshi199901469AhmedAlAmeri199900378CoordinatedBy:Prof.AbdullaIsmailAb
2、dulla1IntroductiontoGraphicalUserInterface(GUI)MATLAB6.5IntroductionAgraphicaluserinterface(GUI)isapictorialinterfacetoaprogram.AgoodGUIcanmakeprogramseasiertousebyprovidingthemwithaconsistentappearanceandwithintuitivecontrolslikepushbuttons,listboxes,sliders,menus,andsoforth.Th
3、eGUIshouldbehaveinanunderstandableandpredictablemanner,sothatauserknowswhattoexpectwhenheorsheperformsanaction.Forexample,whenamouseclickoccursonapushbutton,theGUIshouldinitiatetheactiondescribedonthelabelofthebutton.ThischapterintroducesthebasicelementsoftheMATLABGUIs.Thechapte
4、rdoesnotcontainacompletedescriptionofcomponentsorGUIfeatures,butitdoesprovidethebasicsrequiredtocreatefunctionalGUIsforyourprograms.1.1HowaGraphicalUserInterfaceWorksAgraphicaluserinterfaceprovidestheuserwithafamiliarenvironmentinwhichtowork.Thisenvironmentcontainspushbuttons,to
5、gglebuttons,lists,menus,textboxes,andsoforth,allofwhicharealreadyfamiliartotheuser,sothatheorshecanconcentrateonusingtheapplicationratherthanonthemechanicsinvolvedindoingthings.However,GUIsareharderfortheprogrammerbecauseaGUI-basedprogrammustbepreparedformouseclicks(orpossiblyke
6、yboardinput)foranyGUIelementatanytime.Suchinputsareknownasevents,andaprogramthatrespondstoeventsissaidtobeeventdriven.ThethreeprincipalelementsrequiredtocreateaMATLABGraphicalUserInterfaceare1.Components.EachitemonaMATLABGUI(pushbuttons,labels,editboxes,etc.)isagraphicalcomponen
7、t.Thetypesofcomponentsincludegraphicalcontrols(pushbuttons,editboxes,lists,sliders,etc.),staticelements(framesandtextstrings),menus,andaxes.Graphicalcontrolsandstaticelementsarecreatedbythefunctionuicontrol,andmenusarecreatedbythefunctionsuimenuanduicontextmenu.Axes,whichareused
8、todisplaygraphicaldata,arecreatedbythefunctiona