?? demo2.m
字號:
%**********************
%求系統的能控規范型、能觀規范型、對角型或Jordan型
wind_demo2=figure('color',[1,1,1],'position',[0.1*winw,0.1*winh,0.8*winw,0.8*winh],...
'name','習題演示窗口2:求系統的能控規范型、能觀規范型、對角型和Jordan型','numbertitle','off','menubar','none',...
'resize','off','clipping','off');
color=[0.9;.9;.9];
uicontrol('style','frame','position',[0,0,1,1],...
'units','normalized','backgroundcolor',color);
pos=[0.04,0.92,0.25,0.04];
showtext(pos,color,'輸入系統狀態空間:');
color=[.8;.8;0.8];
uicontrol('style','frame','position',[0.035,0.65,.3,.25],...
'units','normalized','backgroundcolor',color);
pos=[0.04,0.83,0.02,0.04];
showtext(pos,color,'A:');
demo_edita=uicontrol(wind_demo2,'style','edit','pos',[0.06,0.83,0.26,0.04],...
'string','[]','back',[0,0.7,1],'units','normalized');
pos=[0.04,0.78,0.02,0.04];
showtext(pos,color,'B:');
demo_editb=uicontrol(wind_demo2,'style','edit','pos',[0.06,0.78,0.26,0.04],...
'string','[]','back',[0,0.7,1],'units','normalized');
pos=[0.04,0.73,0.02,0.04];
showtext(pos,color,'C:');
demo_editc=uicontrol(wind_demo2,'style','edit','pos',[0.06,0.73,0.26,0.04],...
'string','[]','back',[0,0.7,1],'units','normalized');
pos=[0.04,0.68,0.02,0.04];
showtext(pos,color,'D:');
demo_editd=uicontrol(wind_demo2,'style','edit','pos',[0.06,0.68,0.26,0.04],...
'string','[0]','back',[0,0.7,1],'units','normalized');
color=[.9;.9;0.9];
pos(1)=0.33;pos(2)=0.6;pos(3)=0.25;showtext(pos,color,'能控規范型');
pos(1)=0.33;pos(2)=0.29;pos(3)=0.25;showtext(pos,color,'能觀規范型');
pos(1)=0.5;pos(2)=0.92;pos(3)=0.25;showtext(pos,color,'Jordan型');
color=[.8;.8;0.8];
uicontrol('style','frame','position',[0.032,0.34,.77,.25],...
'units','normalized','backgroundcolor',color);
uicontrol('style','frame','position',[0.35,0.65,.62,.25],...
'units','normalized','backgroundcolor',color);
uicontrol('style','frame','position',[0.032,0.03,.77,.25],...
'units','normalized','backgroundcolor',color);
str=['color=[.8;.8;.8];',...
'demoa=eval(get(demo_edita,''string''));demob=eval(get(demo_editb,''string''));',...
'democ=eval(get(demo_editc,''string''));demod=eval(get(demo_editd,''string''));',...
'[a1,b1,c1,d1,t1]=canon(demoa,demob,democ,demod,''model'');',...
'[a2,b2,c2,t2,k2]=ctrbf(demoa,demob,democ);',...
'[a3,b3,c3,t3,k3]=obsvf(demoa,demob,democ);',...
'pos=[0.42,0.83,0.53,0.04];showtext(pos,color,mat2str(a1));',...
'pos=[0.42,0.78,0.53,0.04];showtext(pos,color,mat2str(b1));',...
'pos=[0.42,0.73,0.53,0.04];showtext(pos,color,mat2str(c1));',...
'pos=[0.42,0.68,0.53,0.04];showtext(pos,color,mat2str(d1));',...
'pos=[0.1,0.52,0.68,0.04];showtext(pos,color,mat2str(a2));',...
'pos=[0.1,0.47,0.68,0.04];showtext(pos,color,mat2str(b2));',...
'pos=[0.1,0.42,0.68,0.04];showtext(pos,color,mat2str(c2));',...
'pos=[0.1,0.37,0.68,0.04];showtext(pos,color,mat2str(demod));',...
'pos=[0.1,0.21,0.68,0.04];showtext(pos,color,mat2str(a3));',...
'pos=[0.1,0.16,0.68,0.04];showtext(pos,color,mat2str(b3));',...
'pos=[0.1,0.11,0.68,0.04];showtext(pos,color,mat2str(c3));',...
'pos=[0.1,0.06,0.68,0.04];showtext(pos,color,mat2str(demod));']
uicontrol(wind_demo2,'style','push','string','Transform',...
'position',[0.82,0.4,0.17,0.06],'units','normalized',...
'callback',str);
uicontrol(wind_demo2,'style','push','string','Close',...
'position',[0.82,0.2,0.17,0.06],'units','normalized',...
'callback','close(wind_demo2)');
%**************
color=[.8;.8;.8];
pos=[0.37,0.83,0.04,0.04];
showtext(pos,color,'A:');
%***********
pos=[0.37,0.78,0.04,0.04];
showtext(pos,color,'B:');
%***********
pos=[0.37,0.73,0.04,0.04];
showtext(pos,color,'C:');
%***********
pos=[0.37,0.68,0.04,0.04];
showtext(pos,color,'D:');
%***********
%$$$$$$$$$$$$$$
pos=[0.05,0.52,0.04,0.04];
showtext(pos,color,'A:');
%***********
pos=[0.05,0.47,0.04,0.04];
showtext(pos,color,'B:');
%***********
pos=[0.05,0.42,0.04,0.04];
showtext(pos,color,'C:');
%***********
pos=[0.05,0.37,0.04,0.04];
showtext(pos,color,'D:');
%***********
%$$$$$$$$$$$$$$
pos=[0.05,0.21,0.04,0.04];
showtext(pos,color,'A:');
%***********
pos=[0.05,0.16,0.04,0.04];
showtext(pos,color,'B:');
%***********
pos=[0.05,0.11,0.04,0.04];
showtext(pos,color,'C:');
%***********
pos=[0.05,0.06,0.04,0.04];
showtext(pos,color,'D:');
%***********
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -