正在加载图片...
在编写句柄图形函数的M文件时,函数mmap描述了一种很有用的技术。它利用函数 waitforbuttonpress和gco的结合用鼠标来获取所选定对象的句柄。 waifortbuttonpress是一个 MATLAB内置函数,它的功能是等待鼠标点击或按键。它的帮助文本如下: > help waitforbuttonpress WAITFOR BUTTONPRESS Wait for key/buttonpress over figure T- WAITFOR BUTTONPRESS stops program execution untill a key or mouse button is pressed over a figure window Returns when terminated by a mouse buttonpress, or when terminated by a keypress. Additional information about the terminating event is available from the current figure See alSo INPUT gCF 帮助信息 WAITFORBUTTONPRESS等待一个鼠标/按钮对图形按下 T= WAITFORBUTTONPRESS停止程序的执行,直到鼠标按钮或键在一个图形窗口按下。 当鼠标按钮按下时返回0:当键按下时返回1。其它的结束事件的信息可从当前的图形中窗口 获取。 参阅 GINPUT和GCF 鼠标按钮在鼠标指针指的图形上按下后,函数gco返回所点中对象的句柄。然后,该句柄 可用来操作选中的对象。在精通MA∏LAB工具箱中,用这种简单的选择技术的函数还有 mmline 和 mmaxes。其中, mmline的M文件描述如下 function mmline(argl, arg2, arg3, arg 4, arg 5, arg6) %MMLINE Set Line Properties Using Mouse MMLINE waites for a mouse click on a line then applies the desired properties to the selected line Properties are given in parts, e.g., MMLINE Name value %o Properties VaLUe default) o color TY m crgb wk]or an RGB in quotes: ' bl style mark points for linewidth 10.5)end end 在编写句柄图形函数的 M 文件时,函数 mmzap 描述了一种很有用的技术。它利用函数 waitforbuttonpress 和 gco 的结合用鼠标来获取所选定对象的句柄。waifortbuttonpress 是一个 MATLAB 内置函数,它的功能是等待鼠标点击或按键。它的帮助文本如下: » help waitforbuttonpress WAITFOR BUTTONPRESS Wait for key/buttonpress over figure. T= WAITFOR BUTTONPRESS stops program execution untill a key or mouse button is pressed over a figure window.Returns 0 when terminated by a mouse buttonpress,or 1 when terminated by a keypress.Additional information about the terminating event is available from the current figure. See also GINPUT,GCF. 帮助信息: WAITFORBUTTONPRESS 等待一个鼠标/按钮对图形按下。 T=WAITFORBUTTONPRESS 停止程序的执行,直到鼠标按钮或键在一个图形窗口按下。 当 鼠标按钮按下时返回 0;当键按下时返回 1。其它的结束事件的信息可从当前的图形中窗口 获取。 参阅 GINPUT 和 GCF。 鼠标按钮在鼠标指针指的图形上按下后,函数 gco 返回所点中对象的句柄。然后,该句柄 可用来操作选中的对象。在精通 MATLAB 工具箱中,用这种简单的选择技术的函数还有 mmline 和 mmaxes。其中,mmline 的 M 文件描述如下: function mmline(arg1,arg2, arg3, arg4, arg5, arg6) %MMLINE Set Line Properties Using Mouse % MMLINE waites for a mouse click on a line then applies the desired properties to the % selected line. % Properties are given in parts,e.g.,MMLINE Name value... % Properties: % NAME VALUE{default} % color [Y m c r g b w k] or an RGB in quotes: ‘[r g b]’ % style [- -- ; -.] % mark [o + . * X] % width points for linewidth {0.5}
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有