资源描述:
《matlab实用程序百例之界面设计篇》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、1-32是:图形应用篇33-66是:界面设计篇67-84是:图形处理篇85-100是:数值分析篇实例33:曲线转换按钮h0=figure('toolbar','none',...'position',[200150450250],...'name','实例33');x=0:0.5:2*pi;y=sin(x);h=plot(x,y);gridonhuidiao=[...'ifi==1,',...'i=0;,',...'y=cos(x);,',...'delete(h),',...'set(hm,''string'','
2、'正弦函数''),',...'h=plot(x,y);,',...'gridon,',...'elseifi==0,',...'i=1;,',...'y=sin(x);,',...'set(hm,''string'',''余弦函数''),',...'delete(h),',...'h=plot(x,y);,',...'gridon,',...'end,',...'end'];hm=uicontrol(gcf,'style','pushbutton',...'string','余弦函数',...'callback',h
3、uidiao);i=1;set(hm,'position',[250206020]);set(gca,'position',[0.20.20.60.6])title('按钮的使用')holdon实例34:栅格控制按钮h0=figure('toolbar','none',...'position',[200150450250],...'name','实例34');x=0:0.5:2*pi;y=sin(x);plot(x,y)huidiao1=[...'set(h_toggle2,''value'',0),',...'g
4、ridon,',...];huidiao2=[...'set(h_toggle1,''value'',0),',...'gridoff,',...];h_toggle1=uicontrol(gcf,'style','togglebutton',...'string','gridon',...'value',0,...'position',[20455020],...'callback',huidiao1);h_toggle2=uicontrol(gcf,'style','togglebutton',...'strin
5、g','gridoff',...'value',0,...'position',[20205020],...'callback',huidiao2);set(gca,'position',[0.20.20.60.6])title('开关按钮的使用')实例35:编辑框的使用h0=figure('toolbar','none',...'position',[200150350250],...'name','实例35');f='Pleaseinputtheletter';huidiao1=[...'g=upper(f);,
6、',...'set(h2_edit,''string'',g),',...];huidiao2=[...'g=lower(f);,',...'set(h2_edit,''string'',g),',...];h1_edit=uicontrol(gcf,'style','edit',...'position',[10020010050],...'HorizontalAlignment','left',...'string','Pleaseinputtheletter',...'callback','f=get(h1_e
7、dit,''string'');',...'background','w',...'max',5,...'min',1);h2_edit=uicontrol(gcf,'style','edit',...'HorizontalAlignment','left',...'position',[10010010050],...'background','w',...'max',5,...'min',1);h1_button=uicontrol(gcf,'style','pushbutton',...'string','小写
8、变大写',...'position',[1004510020],...'callback',huidiao1);h2_button=uicontrol(gcf,'style','pushbutton',...'string','大写变小写',...'position',[1002010020],...'callback',huidiao2);实