set(gcf,'position',[100,200,650,450]);
set(gcf,'menubar','none','name','sample','numbertitle','off');
hdraw=uimenu(gcf,'Label','&draw');
hmeshg=uimenu(hdraw,'Label','meshgrid','Call',...
['x=0:0.1:2*pi;','[x,y]=meshgrid(x);','plot(x,y,"*")','grid on;',...
'view(3);']);
hmesh=uimenu(hdraw,'Label','mesh','Call','mesh(peaks);');
hsurf=uimenu(hdraw,'Label','surf','Call','surf(peaks);');
hcolormap=uimenu(gcf,'Label','&colormap');
hcool=uimenu(hcolormap,'Label','&cool','Call','colormap(cool);');
hhot=uimenu(hcolormap,'Label','&hot','Call','colormap(hot);');
hdefault=uimenu(hcolormap,'Label','&default','Call',...
'colormap(jet);');
uimenu(gcf,'Label','&exit','Call','close(gcf)');
hfaceted=uicontrol(gcf,'style','push','string','faceted','call',...
'shading faceted;','position',[500,300,80,34]);
hfalt=uicontrol(gcf,'style','push','string','falt','call',...
'shading flat;','position',[500,250,80,34]);
uicontrol(gcf,'style','push','string','interp','call',...
'shading interp;','position',[500,200,80,34]);
hxd=uicontrol(gcf,'style','edit','position',[510,140,30,30]);
hyd=uicontrol(gcf,'style','edit','position',[570,140,30,30]);
view=['x=str2num(get(hxd,"string"));','y=str2num(get(hyd,"string"));',...
'view(x,y);'];
uicontrol(gcf,'style','text','string','x','position',[485,145,20,20]);
uicontrol(gcf,'style','text','string','y','position',[545,145,20,20]);
hview=uicontrol(gcf,'style','push','string','view','position',[500,100,80,30],...
'call',view);
hedit=uicontrol(gcf,'style','edit','position',[40,45,420,30]);
hok=uicontrol(gcf,'style','push','string','OK','position',[488,47,45,25],...
'call',['t=get(hedit,"string";)','eval(t);']);
hclear=uicontrol(gcf,'style','push','string','clear','position',[555,47,45,25],...
'call','set(hedit,"string"," ");');
我编的的 各位大大看一下 |