set(gco, ' Units ' , ' data ' ,... ' HorizontalAlignment ' , ' left ' ,... mmdraw是精通MATLAB工具箱中另一个有用GUI函数,它与mmtext十分相似,但更为复杂,此函数允许用户用鼠标在当前的坐标轴上画线并设置线的属性。 function mmdraw(arg1,arg2,arg3,arg4,arg5,arg6,arg7) %MMDRAW Draw a Line and Set Properties Using Mouse. %MMDRAW Draw a Line in the current axes using to the mose. %Click at the starting point and drag to the end point %In addition,properties can be given to the line. %Properties are given in pairs,e.g.,MMDRW name vale... %Properties: %NAME VALUE (defult) %color [y m c r g b {w} k] or an rgb in quotes: ' [r g b] %style [-----{:}--.] %mark [0 + . * x] %width points for linewidth {0.5} %size points for marker size {6} %Examples: %MMDRAW color r width 2 sets color to red and width to 2 points%MMDRAW mark + size 8 set marker type to +and size to 8 points %MMDRAW color ' [1 5 0] ' set color to orange %Copyright (c) 1996 by Prentice-Hall,Inc. global MMDRAW_Hl MMDRAW_EVAL if nargin==0 arg1= ' color ' ;arg2= ' w ' ;arg3= ' style ' ;arg4= ' : ' ;nargin=4; end if isstr(arg1) % initial call,set thing up if isempty(Hf),error( ' No Figure Available. ' ),end Ha=findobj(Hf, ' Type, ' axes ' ); if isempty(Ha),error( ' No Axes in Current Figure. ' ),end set(Hf, ' Pointer ' , ' Crossh ' ,...%set up callback for line star ' BackingStore ' , ' off ' ,... ' WindowButtonDownFcn ' , ' mmdraw(1) ' ) figure(Hf) MMDRAW_EVAL= ' mmdrw(99);%set up string to set attributes for i=1:nargin argi=eval(sprintf( ' arg%.of ' ,i)); MMDARW_EVAL=[MMDARW_EVAL ' , ' ' arg ' ' ' ' ]; end MMDARW_EVAL=[MMDARW_EVAL ,) ' ]; elseif arg1==1 % callback is line start point fp=get(gca, ' CurrentPoint ' ); %start point set(gca, ' Userdata ' ,fp(1,1:2)) %store in axes userdata set(gcf, ' WindowButtonMotionFcn ' , ' mmdraw(2) ' ,... ' ' WindowButtonUpFcn ' , ' mmdraw(3) ' ) elseif arg1==2 % callback is mouse motion cp=get(gca, ' CurrentPoint ' );cp=cp(1,1:2); fp=get(gca, ' Userdata ' ); H1=line( ' Xdata ' ,[fp(1);cp(1)], ' Ydata ' ,[fp(2);cp(2)],... ' EraseMode ' , ' Xor,... ' Color ' , ' w ' , ' LineStyle ' , ' : ' ,... "Clipping ' , ' off ' ; if ~isempty(MMDRAW_HL) % delete prior line if it exsts delete(MMDRAW_HL) end MMDRAW_HL=H1; % store current line handle elseif arg1==3 % callback is line end point,finish up set(gcf, ' Point ' , ' arrow,... ' BackingStore ' , ' on ' ,... ' WindowButtonDownFcn ' , ' ,... ' WindowButtonMotionFcn ' , ' mmtext(2) ' ,... ' WindowButtonUpFcn ' , ' ' ) set(gca, ' Userdata ' ,[]) set(MMDRAW_HL, ' EraseMode ' , ' normal ' ) % render line better eval(MMDRAW_EVAL) MMDRAW_EVAL=[]; elseif arg1==99 % process line properties for i=2:2:nargin-1 name=eval(sprintf( ' arg%.of ' ,i),[]); % get name argument vale=eval(sprintf( ' arg%.of ' ,i+1),[]); % get value argument if strcmp(name, ' color ' ) if value(1)== ' [ ' ,value=eval(value);end set(MMDRAW_HL, ' color ' ,value) elseif strcmp(name, ' style ' ) set(MMDRAW_HL, ' Lineatyle ' ,value) elseif strcmp(name, ' mark ' ) set(MMDRAW_HL, ' Linestyle ' ,value) elseif strcmp(name, ' width ' ) value=abs(eval(value)); set(MMDRAW_HL, ' LineWidth ' ,value) elseif strcmp(name, ' size ' ) value=abs(eval(value)); set(MMDRAW_HL, ' MarkerSize ' ' ,value) end end MMDRAW_HL=[]; end 虽然这里说明太长,但精通MATLAB工具箱中的函数mmsetc和mmsetf都是使用递归、全局变量和 ' UserData ' 属性的GUI函数的直观例子。也许愿意看一下mmsetclr M文件,它是函数mmsetc文件的脚本M文件。比较这两个文件,可以了解到,为实现各种GUI M文件要做出一些折衷。 21.9 对话框和请求程序 MATLAB具有建立对话框和 ' 请求 ' 的几个有用工具。对话框是弹出显示的单独窗口,它显示信息字符串。对话框含有一个或多个按钮键以供用户输入。请求框是在弹出显示的单独窗口,利用鼠标或键盘获得输入,并返回信息给调用函数。 对话框 所有MATLAB的对话框都是基于函数dialog,它的帮助文本如下 >>help diolog DIALOG displays a dialog box. FIG = DIALOG (pl ,vl....)displays a dialog box. valid param/value pairs include Style error | warning | help | question Name string Replace on | off Resize on | off BackgroundColor ColorSpec ButtonString ' Button1String | Button2String | ... ' ButtonCalls ' ButtonCallback | Button2Callback | ... ' ForegroundColor ColorSpec Position [x y width height] [x y] - centers around screen point TextString string Units pixels | normal | cent | inches | points UserData matrix Note: Until dialog becomes built-in, set and get are not valid for dialong objects. At most three buttons are allowed. The callbacks are ignored for"question"dialogs. If ButtonStrings /ButtonCalls are unspecified then it defaults to a single "ok" button which removes the figure. There ' s still problems with making the question dialog modal. The entire parameter name must be passed in. (i.e. no automatic completion). Nothing beeps yet. See also ERRORDLG,HELPDLG,QUESTDLG 注意:对话窗本身不是句柄图形对象,而是由一系列句柄图形对象构成的M文件。对话窗口是图形,包括与框架、编辑和按钮uicontrol对象共存的坐标轴。在将来的版本中,dialog可能成为具有更多功能的内置函数。缺省的对话框是一个帮助对话框,它是由 ' Default help string ' 字符串和标有 ' OK ' 的按钮键组成的编辑文本框。作为例子,键入>> dialog。 预先定义的对话框是由函数helpdlg,enordlg,warndlg和gucstdlg建立。helpdlg和warndlg接受文本字符串和窗口标题字符串作为输入参量。errordlg接收 ' Replace ' 变量作为输入。除了questdlg,所有上述函数都产生类似的对话框,它有各自缺省的标题和文本字符串。标有 ' OK ' 的单个按钮,则关闭对话框。helpdlg帮助文本是: >> help helpdlg HELPDLG: Displays a help dialog box. HANDLE=HELPDLG(HELPSTRING,DLGNAME) displays the message HelpString in a dialog box with title DLGNAME. if a help dialog with that name is aldeady on the screen, it is brought to the front.Otherwise it is created. See also:DIALOG 帮助信息 Helpdlg:显示一个帮助文本框 HANDLE = HELPDLG(HELPSTRING,DLGNAME)在对话框中显示标题为dlgname的帮助信息helpstring。如果名为dlgname的帮助对话框已在屏幕上显示,则引到屏幕正面,否则就建立该帮助对话框。 参阅:dialog warndlg的帮助文本是: >>help warndlg WARNDLG Creates a warning dialog box. HANDLE=WARNDLG(WARNSTR,DLGNAME) creates a warning diolog box which displays WARNSTR in a window named DLGNAME.A pushbutton labeled OK must be pressed to make the warning box disappear. See also:DIALOG errordlg的帮助文本是 >>help errordlg ERRORDLG Creates an error dialog box HANDLE = ERRORDLG(ERRORSTR,DLGNAME,Replace) creates an error dialog box which diplays ERRORSTR in a window nnnamed DLGNAME.A pushbutton labeled OK must be pressed to make the error box disappear.If REPLACE= ' on ' and an error dialog with Name DLGNAME already exits,it is simply brought to the front (no new dialog is created). See also :DIALOG 帮助信息 ERRORDLG:建立出错对话框 HANDLE=ERRORDLG(ERRORSTR,DLGNAME,REPLACE)建立显示出错信息errorstr、名为dlgname的出错对话框,要消除出错信息对话框,必须揿下标记为OK的按钮,如果replace= ' on ' 并且名为digname的出错对话框已经存在,则就引到屏幕正面,不再建立新的对话框。 参阅:dialog 提问的对话框稍有不同,前三种函数只显示一个按钮键并返回对话框图形对象的句柄。函数questdlg显示两个或三个按钮键,返回由用户所选的按钮的标志字符串。questdlg的帮助文本如下: >>help qeustdlg QEUSTDLG Creates a question dialog box. CLICK=QUESTDLG(Q,YES,O,CANCEL,DEFAULT) creates a question dialog box which displays Q.Up to three pushbuttons, with strings given by YES,NO,and CANCEL,will appear along with Q in the dialog.The dialog wil be destroyed returning the string CLICK depending on which button is clicked.DEFAULT is the default button number. 帮助信息 QUESTDLG:建立问题对话框 CLICK=QVESTDLG(Q,YES,NO,CANCEL,DEFAULT)建立显示信息Q的问题对话框。至多有三个按钮具有由YES,NO和CANCEL给定的字符串,按钮与Q一起,显示在对话框中。根据所击的按钮返回字符串CLICK对话框消失。DEFAULT是缺省的按钮数。 下面是函数的片断,说明了函数中提问对话框的应用: question1= ' Change color map to copper? ' ; response1=questdlg(question1, ' Sure ' , ' Nope ' , ' Maybe ' ,2); if stromp(response1, ' Sure ' ) colormap(copper); elseif stromp(response1, ' Maybe ' ) wandlg( ' That response does not compute! ' ); response2=questdly([ ' Please make up your mind.| ' question1], ' Yes ' , ' No ' ); if stromp (response2, ' Yes ' ) colormap(copper); end end 请求程序 请求程序通过对话框获取用户的输入。请求程序是内置式GUI函数,它使用平台原有的窗口系统建立外观熟悉的请求程序。 函数uigecfile和uiputfile是所有平台上都有的内置式函数,用于交互地获得文件名,从而调用函数用它读取文件中数据或将数据存于文件中。uigetfile的帮助文本是: >>help uigetfile UIGETFILE Interactively retrieve a filename by displaying a dialog box. [FILENAME,PATHNAME]=UIGETFILE( ' filterSpec ' , ' dialogTitle ' ,X,Y) displays a dialog box for the user to fill in,and returns the filename and path strings.A successful return occurs only if the file exists.If the user selects a file that does not exist, an error message is displayed,and control returns to the dialog box. The user may then enter another filename,or press the Cancel button. All parameters are optional,but if one is used,all previous parameters must also be used. The felterSpec parameter determines the initial display of files in the dialog box.For example ' *.m ' lists all the MATLAB M-files. Parameter ' dialogTitle ' is a string containing the title of the dialog box. The X and Y parameters define the initial position of the dialog box in units of pixels. Some systems may not support this option. The output variable FILENAME is a string containing the mane of the file selected in the dialog box.If the user presses the Cancel button or if any error occurs,it is set to 0. The output parameter PATHNAME is a string containing the path of the file selected in the dialog box. If the user presses the Cancel button or if any error occurs,it is set to 0. See also UIPUTFILE. 帮助信息 UIGETFILE:通过显示对话框交互式地检索文件名 [FILENAME,ATHNAME]=UIGETFILE( ' filterspec ' , ' dialogtitle ' ,x,y)显示一个对话框,让用户输入,并返回路径和文件名字符串。仅当文件存在时,才成功地返回。如果用户选择了一个并不存在的文件,就显示出错信息,控制框返回到对话框。用户可以输入另一个文件名或揿下Cancel按钮。 所有输入参数都是可任选的,如果用其中之一个,也必须使用所有先前参数。 参数filteospec决定对话框中文件的初始显示。例如 ' *.m ' 列出的所有M文件。 参数 ' dialogtitle ' 是对话框标题字符串。 以象素为单位参数x,y定义对话框的初始位置,有些系统可能不支持这个选项。 输出变量filename是对话框内所选文件的名称字符串。如果用户揿了取消按钮或有错误发生,filename的值设置为0。 输出参数pathname是对话框内所选文件的路径名字符串。如果用户揿了取消按钮或有错误发生,pathname的值设置为0。 参阅 uiputfile 下面的例子说明了在函数中如何利用uigetfile,交互式地检索ASCII码数据文件,并绘制正弦数据 % Ask the user for a file name. [datafile datapath]=uigetfile( ' .dat ' , ' Choose a data file ' ); % If the user selected an existing file,read the data. % (The extra quotes avoid problems with spaces in file or path names % on the Macintosh platform.) % Then determine the variable name from the file name, % copy the data to a variable,and plot the data. if datafile eval([ ' load( ' ' ' datapath datafile ' ' ' ) ' ] ' ); x=eval(strtok(datafile. ' . ' ); plot (x,sin(x)); end 请求程序不接受并不存在的文件名。这种情况可能发生的原因是用户在请求程序中把文件名输入到文件框中。Macintosh版本无文本框的,用户必须选择一个存在的文件或揿下Cancel按钮以退出请求程序。 函数uiputfile与函数uigetfie十分相似:输入参量相似,而且两者均返回文件和路径字符串,uiputfile的帮助文件是 >> help uiputfile UIPUTFILE Interactively retrieve a filename by displaying a dialog box. [FILENAME,PATHNAME]=UIPUTFILE( ' inifFile ' , ' dialogTitle ' ) displays a dialog box and returns the filename and path strings. The initFile paramete determines the initial display of files in the dialog box.Full file name specifications as well as wildcards are allowed.For example, ' newfile.m ' initializes the display to that particular file and lists all othe existing .m files.This may be used to provide a default file mane. A wildcard specification such as ' *.m ' lists all the existing MATLAB M-files. Parameter ' dialogTitle ' is a string containing the title of the dialog box. The output variable FILENAME is a string containing the name of the file selected in the dialog box. If the user presses the Cancel butto or if any error occurs,it is set to 0. The output variable FILENAME is a string containing the name of the file selected in the dialog box. If the user presses the Concel button or if any error occurs,it is set to 0. [FILENAME,PATHNAME]=UIPUTFILE ( ' initFile ' , ' dialogTitle ' ,X,Y) places the dialog box at screen position [X,Y] in pixel units. Not all systems support this option. Example: [newmatfile,newpath]=uiputfile ( ' *.mat ' . ' Save As ' ); See also UIGETFILE. 如果用户选择了已经存在的文件,则出现一个对话窗,询问用户是否要删除存在的文件。如果回答no,则返回原来的请求程序等待另一次尝试;如果回答yes,则关闭请求程序和对话框并把文件名返回,文件并未被请求程序删除。如果需要,调用函数必须删除或覆盖文件。 值得牢记的是,这些函数中不论哪一个都未真正地读或写任何文件,调用函数必须做这些工作。这些函数仅仅是将文件名和路径返回给调用函数。 在MS-Windows和Macintosh平台上,uisetcolor让用户交互式地选择颜色并选择性地将此颜色施加到一个对象上。如同MATLAB4.2C版本,X Window系统平台不支持uisetcolor。 uisetcolor的帮助文本是: >>help uisetclor UISETCOLOR Interactively set a ColorSpec by displaying a dialog box. C=UISETCOLOR(ARG, ' dialogTitle ' ) displays dialog box for the user to fill in,and applies the selected color to the input graphics object. The parmeters are optional and may be specified in any order. ARG may be either a handle to a graphics object or an RGB triple. If a handle is used,it must specify a graphics object that supports color.If RGB is used,it must be a valid RGB triple (e.g.,[1 0 0] for red). In both cases,the color specified is used to initialize initializes the color to black. If parameter ' dialogTitle ' is used, it is a string containing the title of the dialog box. The output value C is the selected GB triple. If the input parmeter is a handle,the graphics object ' s color is set to the RGB color selected. If the user presses Cancel from the dialog box,or if any error occurs,the output value is set to input RGB triple,if provided; otherwise,it is set to 0. Example: C=uisetcolor(hText, ' Set Text Color ' ) NOTE:This function is only available in MS-Windows and Macintosh versions of MATLAB. 帮助信息 UISETCOLOR :显示对话框,交互式地设置ColorSpace。 C=UISETCOLOR(ARG, ' dialogtitle ' )显示一个对话框,让用户输入,并将所选颜色用于输入的图形对象。 参数是可任选,并可以以任何次序指定。 ARG可以是一个图形对象的句柄或是RGB3元组。如果使用句柄,必须指定支持颜色的图形对象;如果使用RGB,必须是有效的RGB3元组(如:[1 0 0]是红色)。在这两种情况下,所指定的颜色用于对话框的初始化。如果没有指定初始的RGB,将对话框初始化为黑色。 如果使用参数 ' dialogTitle ' ,该参数是对话框名称的字符串。 输出值C是所选的RGB3元组。如果输入参数是句柄,则图形对象的颜色就设定为所选的颜色。 如果用户揿下对话框中的Cancel按钮或有错误发生,输出值就设定为输入的RGB3元组;如果没有输入RGB3元组,则输出值设置为0。 例如:c=uisetcoior(htext, ' settextcoior ' ) 注意:该函数仅在的MS-Windous和Macintosh版本中可用。 精通MATLAB工具箱具有前面所提及的函数mmsetc。该函数可在所有的平台上工作,功能与uisetcolor十分相似。mmsetc甚至可允许用户用鼠标来选择颜色并将所选的颜色加到所选择的对象上。以下就是mmsetc的帮助文本: >> help mmsetc MMSETC Obtain an RGB triple interactively form a color sample. MMSETC displays a box for the user to select a color nteractively and displays the result. X=MMSETC returns the selected color in X. MMSETC ([r g b]) uses the RGB triple as the initial RGB value for modification. MMSETC C -or- MMSETC ( ' C ' ) where C is a color spec (y,m,c,r,g,b,w,k),uses the specified color as the initial value. MMSETC(H) where the input argument H is the handle of a valid graphics object that supports color,uses the color progerty of the object as the initial RGB value. MSETC select -or- MMSTEC( ' select ' ) waits for the user to click on a valid graphics object that supports color,and uses the color property of the object as the initial RGB value. If the initial RGB value was obtained from an object or object handle,the ' Done ' pushbutton will apply the resulting color property to the selected object. If no initial color is specified,black will be used. Examples: mmsetc mycolor=mmsetc mmsetc([.25 .62 .54]) mmsetc(H) mmsetc g mmsetc red mmsetc select mycolor=mmsetc( ' select ' ) 下面的例子是利用精通MATLAB工具箱中函数mmap和mmsetc,交互式地使用单色映象: >>mesh(peaks) >>coiormap(mmap(mmsetc)) 在MS-Windows和Machitosh平台上,有最后的请求程序uisetfont,它让用户可交互式选择字型属性并将其加于对象上。如同MATLAB4.2c版本,X Window系统平台不支持uisetfont。uisetfont帮助文件是: >> help uisetfont UISETFONT Interactively set a font by displaying a dialog box. H=UISETFONT(HIN, ' dialogTitle ' ) displays a dialog box for the user to fill in,and applies the selected font to the input graphics object. The parmeters are optional and may be specified in any order. If parameter HIN is used,it must specity a handle tp a text or axis graphics object. The font properties currently assigned to this object are used to initialize the font dialog box. If parameter ' dialogTitle ' is used,it is a string containing the title of the dialog box. The output H is a handle to graphics object. If HIN is specified, H is identical to HIN.If HIN is not specified,a nwe text object is created with the selected font properties, and its handle is returned. If the user presses Cancel from the dialog box,or if any error occurs,the output value is set to the input handle,if provided; otherwise ,it is set to 0. Example: uisetfont(hText, ' Update Font ' ) NOTE:This function is only available in MS-Windows and Macintosh versions of MATLAB. 精通MATLAB工具箱有一个称为函数mmsetf,功能类似于uisetfont。但可工作在所有平台上。mmsetf甚至可允许用户用鼠标来选择文本对象,然后将所选的字体属性加在所选的对象上。以下就是mmsetf的帮助文本: >>help mmsetf MMSETF Choose font characteristics interactively. MMSETF displays a dialog box for the user to select fornt characteristics. X=MMSETF returns the handle of the text object or 0 if an error occurs of ' Cancel ' is pressed. MMSETF(H) where the input argument H is the handle of a valid text or axes object,uses the font characteristics of the object as the initial values. MMSETF select -or- MMSETF ( ' select ' )waits for the user to click on a valid graphics object,and uses the font characteristics of the object as the initial values. If the initial values were obtained from an object or object handle,the ' Done ' pushbutton will apply the resulting text properties to the selected object. If no initial object handle is specified,a zero is returned in X. Examples: mmsetf mmsetf(H) mmsetf select Hx_obj=mmsetf( ' select ' ) 然而mmsetf中用于字体的选择是受限制的。不同的平台类型,甚至同一类型的不同计算机都可能安装了不同的字体。MATLAB的函数uisetfont是置于内部的,并利用计算机平台的操作系统列出可用的字体。因为mmsetf是的GUI 函数,不能确定哪种字体是可用的,所以用了通常可获得的有限选择。字体的大小也因同样原因受到限制。 mmsetf请求程序中的样本文本字符串指明了每一个属性改变的作用。选择后,如果出现的文本字符串并不如所希望的那样,则说明所选择的字体属性(如字体名称、大小等等)在所用计算机上是不存在的。见到的即所得到的。 21.10 用户自制的GUI M文件 许多MATLAB用户充分利用的MATLAB所提供的GUI工具,编写了一些有趣GUI函数。这中间大部分可在MATLAB的 匿名FTP 地址/pub/contrib/graphics路径中得到。Internet资源一章将详细地讨论如何从这一资源库中获得文件的详细指令。 一些M文件和M文件集含有大量的句柄图形GUI对象,并说明了uimenu和uicontrol的使用。其中让人印象最深刻的是科斯·荣格(Keith Roger)编写的matdraw集合。该文件集合可在/pub/contrib/graphics/matdraw2.0目录下获得。该文件集将工具条和画图工具调色板加到图形窗口,效果同集成到MATLAB的绘图程序一样。 另一个值得研究的是派瑞克·马查德(Patrick Marchard)编写的guimaker集合。这是交互式工具的集合,让用户应用GUI来建立GUI函数。可以用鼠标建立GUI对象,放置GUI对象和指定GUI对象的大小。版本1.0以freeware形式发布,即它可以无偿使用。2.0版本以及以后的版本以shareware形式发布的,即你可以无偿地使用30天,然后你需注册并付不多的费用。两个版本均可在的 匿名ftp地址/pub/contrib/graphics路径中得到。 这里只是现有GUI函数很多例子中的一小部分。核实一下。也许会对别人要用但已消失的GUI应用程序有想法。第23章有详细指导信息帮助用户访问现有的MATLAB资源,甚至帮助用户成为M文件的贡献者。 21.11 小结 图形用户界面设计不是为每一个人的。但如果需要,MATLAB使它有可能仅由M文件来建立令人印象深刻的GUI函数。需用mex文件、高级语言或数据库调用对有用的MATLAB函数来建立一个赏心悦目的界面。 对GUI对象的字体控制局限性,在下一版本MATLAB的发行中应有所强调。对话框也有可能在未来成为内置函数。所有这些改进工作将使编写GUI函数更加容易,使它们既与平台无关并且更加悦目。 本章所讨论的函数总结如下 表21.4 句柄图形GUI函数  uimenu(handle, ' PropertyName ' ,value) 创建或改变图形的菜单  uicontrol(handle, ' PropertyName ' ,value) 创建或改变对象的性质  dialog( ' PropertyName ' ,value) 显示对话框  helpdlg( ' HelpString ' , ' DlgName ' ) 显示 ' 帮助 ' 对话框  warndlg( ' WarnString ' , ' DlgName ' ) 显示 ' 警告 ' 对话框  errordlg( ' ErrString ' , ' DlgName ' ,Replace) 显示 ' 出错对话框  questdlg( ' Qstring ' ,S1,s2,s3,Default) 显示 ' 提问 ' 对话框  uigetfile(Filter,Dlgname,X,Y) 交互式地检索文件名  uiputfile(InitFile,Dlgname,X,Y) 交互式地检索文件名  uisetcolor(Handle,Dlgname) 交互式地选择颜色  uisetcolor([r g b],Dlgname) 交互式地选择颜色  uisetfont(Handle,Dlgname) 交互式地选择字体属性   以下是本章所提到的精通MATLAB工具箱中的函数: 表21.5 精通MATLAB工具箱中的句柄图形GUI函数  mmenu uimenu函数示例  mmclock(X,Y) uicontrol函数示例  mmsetclr 函数mmsetc的有限脚本型式  mmview3d 把方位角和仰角的滑标加到图形上  mmcxy 用鼠标显示的x-y坐标  mmtext( ' String ' ) 用鼠标放置和拖曳文本  mmdraw( ' Name ' ,Value) 用鼠标画线并设置属性  mmsetc(Handle) 用鼠标设置颜色属性  mmsetc(ColorSpec)   mmsetc( ' select ' )   mmsetf(Handle) 用鼠标设置字体属性  mmsetf( ' select ' )