![]() |
请高手看一下这个程序,谢谢!
x=0:pi/100:2*pi;
y=2*exp(-0.5*x).*sin(2*pi*x); hl=plot(x,y); hc=uicontextmenu; hls=uimenu(hc,'Label','线型'); hlw=uimenu(hc,'Label','线宽'); uimenu(hls,'Label','虚线','Call','set(hl,"LineStyle",":");'); uimenu(hls,'Label','实线','Call','set(hl,"LineStyle","-");'); uimenu(hlw,'Label','加宽','Call','set(hl,"LineWidth",2);'); uimenu(hlw,'Label','变细','Call','set(hl,"LineWidth",0.5);'); set(hl,'UIContextMenu',hc); 我介绍一下这个程序,就是plot会画出一条线,在那条线上点右键就能选择加宽或者实线虚线,可我在命令窗口运行了以后,出现了一下错误:??? Error: The input character is not valid in MATLAB statements or expressions. ??? Error while evaluating uimenu Callback. 请高手解释一下!:) |
回复: 请高手看一下这个程序,谢谢!
x=0:pi/100:2*pi;
y=2*exp(-0.5*x).*sin(2*pi*x); hl=plot(x,y); hc=uicontextmenu; hls=uimenu(hc,'Label','线型'); hlw=uimenu(hc,'Label','线宽'); uimenu(hls,'Label','虚线','Call','set(hl,''LineStyle'','':'');'); uimenu(hls,'Label','实线','Call','set(hl,''LineStyle'',''-'');'); uimenu(hlw,'Label','加宽','Call','set(hl,''LineWidth'',2);'); uimenu(hlw,'Label','变细','Call','set(hl,''LineWidth'',0.5);'); set(hl,'UIContextMenu',hc); 将所有的双引号都改成两个单引号就可以了。 |
所有时间均为北京时间。现在的时间是 06:17。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.