注册 登录
编程论坛 Matlab

高手帮忙看看是什么原因,运行的时候提示??? Error while evaluating uicontrol Callback

qq603245807 发布于 2012-06-05 17:42, 1264 次点击
clf reset
set(gcf,'menubar','none')
set(gcf,'unit','normalized','position',[0.2,0.2,0.64,0.32]);   
set(gcf,'defaultuicontrolunits','normalized')   
h_axes=axes('position',[0.05,0.2,0.6,0.6]);  
hl=uicontrol(gcf,'style','toggle',...            
      'string','Sine Wave',...
      'position',[0.67,0.80,0.15,0.12],...
      'callback','t=0:pi/50:2*pi;y=sin(t);plot(t,y);');
hf=uicontrol(gcf,'style','toggle',...            
      'string','Sphere',...
      'position',[0.67,0.60,0.15,0.12],...
      'callback',[...
'[x,y,z]=sphere(50),',...
'hl=surf(x,y,z),',...                      %绘制球面
'hc=uicontextmenu,',...           %建立快捷菜单
'hls=uimenu(hc,"Label","渲染"),',...   
'uimenu(hls,"Label","shading flat","Call","shading flat"),',...            %建立菜单项
'uimenu(hls,"Label","shading faceted","Call","shading faceted"),',...
'uimenu(hls,"Label","shading interp","Call","shading interp"),',...
'set(hl,"UIContextMenu",hc),']); %将该快捷菜单和曲线对象联系起来

0 回复
1