資源描述:
《matlab實(shí)例33》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、實(shí)例33:曲線轉(zhuǎn)換按鈕h0=figure('toolbar','none',...???'position',[200150450250],...???'name','實(shí)例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'',''正弦函數(shù)''),',...???'h=plot(x,y);,',...?
2、??'gridon,',...???'elseifi==0,',...???'i=1;,',...???'y=sin(x);,',...???'set(hm,''string'',''余弦函數(shù)''),',...???'delete(h),',...???'h=plot(x,y);,',...???'gridon,',...???'end,',...???'end'];hm=uicontrol(gcf,'style','pushbutton',...???'string','余弦函數(shù)',...???'callback',huidiao);
3、i=1;set(hm,'position',[250206020]);set(gca,'position',[0.20.20.60.6])title('按鈕的使用')holdon實(shí)例34:柵格控制按鈕h0=figure('toolbar','none',...???'position',[200150450250],...???'name','實(shí)例34');x=0:0.5:2*pi;y=sin(x);plot(x,y)huidiao1=[...???????'set(h_toggle2,''value'',0),',...???????
4、'gridon,',...???????];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,
5、'style','togglebutton',...???'string','gridoff',...???'value',0,...???'position',[20205020],...???'callback',huidiao2);set(gca,'position',[0.20.20.60.6])title('開關(guān)按鈕的使用')實(shí)例35:編輯框的使用h0=figure('toolbar','none',...???'position',[200150350250],...???'name','實(shí)例35');f='Pleasein
6、puttheletter';huidiao1=[...???????'g=upper(f);,',...???????'set(h2_edit,''string'',g),',...???];huidiao2=[...???????'g=lower(f);,',...???????'set(h2_edit,''string'',g),',...???];h1_edit=uicontrol(gcf,'style','edit',...???'position',[10020010050],...???'HorizontalAlignmen
7、t','left',...???'string','Pleaseinputtheletter',...???'callback','f=get(h1_edit,''string'');',...???'background','w',...???'max',5,...???'min',1);h2_edit=uicontrol(gcf,'style','edit',...???'HorizontalAlignment','left',...???'position',[10010010050],...???'background','w'
8、,...???'max',5,...???'min',1);h1_button=uicontrol(gcf,'style','pushbutton',...???'string','小寫變大寫',...??