窗口界面菜单项中绘图功能实现不了,谁给解释一下(内附主要语句及说明)
以下是全部语句,用来生成一个窗口界面,但是生成的窗口界面菜单项中Plot项不能执行(点击无任何反应),我猜测可能是'Call'语句写错了,有熟悉的人给解释一下么?谢谢了screen=get(0,'ScreenSize');
W=screen(3);H=screen(4);
figure('Color',[1,1,1],'Position',[0.2*H,0.2*H,0.6*W,0.4*H],'Name','图形演示系统','NumberTitle','off','MenuBar','none');
%定义Plot菜单项
hplot=uimenu(gcf,'Label','&Plot')
uimenu(hplot,'Label','Sine Wave','Call',['t=-pi:pi/20:pi;','y=sin(t);','plot(t,y);',...
'set(hgon,"Enable","on");','set(hgoff,"Enable","on");',...
'set(hbon,"Enable","on");','set(hboff,"Enable","on");']);
uimenu(hplot,'Label','Cosine Wave','Call',['t=-pi:pi/20:pi;','y=cos(t);','plot(t,y);',...
'set(hgon,"Enable","on");','set(hgoff,"Enable","on");',...
'set(hbon,"Enable","on");','set(hboff,"Enable","on");']);
%定义Option菜单项
hoption=uimenu(gcf,'Label','&Option');
hgon=uimenu(hoption,'Label','&Grid on','Call','grid on','Enable','off');
hgoff=uimenu(hoption,'Label','&Grid off','Call','grid off','Enable','off');
hbon=uimenu(hoption,'Label','&Box on','Separator','on','Call','box on','Enable','off');
hboff=uimenu(hoption,'Label','&Box off','Call','box off','Enable','off');
hfigcolor=uimenu(hoption,'Label','&Fig Color','Separator','on');
uimenu(hfigcolor,'Label','&Red','Accelerator','r','Call','set(gcf,"Color","r");');
uimenu(hfigcolor,'Label','&Green','Accelerator','g','Call','set(gcf,"Color","g");');
%定义Quit菜单项
uimenu(gcf,'Label','&Quit','Call','close(gcf)');
PS: 其中划线部分为我猜测的可能出错的地方
[此贴子已经被作者于2007-6-22 14:52:17编辑过]