www.gusucode.com > Matlab精彩编程100例源码程序 > Matlab精彩编程100例源码/实例57/实例57.m
h0=figure('toolbar','none',... 'position',[168 94.5 315 289.5],... 'name','实例57'); h1=axes('parent',h0,... 'position',[0.4 0.4 0.5 0.5],... 'visible','off'); f1=uicontrol('parent',h0,... 'style','frame',... 'position',[15 10 80 70],... 'string','dull',... 'units','points',... 'backgroundcolor',[0.753 0.753 0.753],... 'listboxtop',0,... 'tag','r1',... 'value',1,... 'callback',[... 'set(r1,''value'',1);,',... 'set(r2,''value'',0);,',... 'set(r3,''value'',0);,',... 'material dull']); r1=uicontrol('parent',h0,... 'style','radiobutton',... 'position',[19.5 58.5 72.75 16.5],... 'string','dull',... 'units','points',... 'backgroundcolor',[0.753 0.753 0.753],... 'listboxtop',0,... 'tag','r1',... 'value',1,... 'callback',[... 'set(r1,''value'',1);,',... 'set(r2,''value'',0);,',... 'set(r3,''value'',0);,',... 'material dull']); r2=uicontrol('parent',h0,... 'style','radiobutton',... 'position',[19.5 35.25 72.75 16.5],... 'string','metal',... 'units','points',... 'backgroundcolor',[0.753 0.753 0.753],... 'listboxtop',0,... 'tag','r2',... 'value',0,... 'callback',[... 'set(r2,''value'',1);,',... 'set(r1,''value'',0);,',... 'set(r3,''value'',0);,',... 'material metal']); r3=uicontrol('parent',h0,... 'style','radiobutton',... 'position',[19.5 12.75 72.75 16.5],... 'string','shiny',... 'units','points',... 'backgroundcolor',[0.753 0.753 0.753],... 'listboxtop',0,... 'tag','r3',... 'value',0,... 'callback',[... 'set(r3,''value'',1);,',... 'set(r1,''value'',0);,',... 'set(r2,''value'',0);,',... 'material shiny']); u1=uimenu('parent',h0,... 'label','绘图',... 'backgroundcolor',[0.753 0.753 0.753],... 'tag','u1',... 'callback',[... '[x,y]=meshgrid(-8:0.5:8);,',... 'r=sqrt(x.^2+y.^2)+eps;,',... 'z=sin(r)./r;,',... 'surf(x,y,z),',... 'shading interp']); b1=uicontrol('parent',h0,... 'style','pushbutton',... 'position',[19.5 150 60 20],... 'string','light',... 'units','points',... 'backgroundcolor',[0.753 0.753 0.753],... 'listboxtop',0,... 'tag','b1',... 'callback','camlight headlight'); b2=uicontrol('parent',h0,... 'style','pushbutton',... 'position',[19.5 100 60 20],... 'string','关闭',... 'units','points',... 'backgroundcolor',[0.753 0.753 0.753],... 'listboxtop',0,... 'tag','b2',... 'callback','close');