?? demo3.m
字號:
%判斷系統的穩定性
wind_demo3=figure('color',[1,1,1],'position',[0.2*winw,0.3*winh,0.6*winw,0.4*winh],...
'name','習題演示窗口3:用Lyapunov判據確定系統的穩定性','numbertitle','off','menubar','none',...
'resize','off','clipping','off');
color=[.9;0.9;0.9];
key=0;
uicontrol('style','frame','position',[0,0,1,1],...
'units','normalized','backgroundcolor',color);
pos=[0.01,0.78,0.25,0.07];
showtext(pos,color,'輸入系統狀態空間:');
color=[.8;.8;0.8];
uicontrol('style','frame','position',[0.025,0.62,.7,.12],...
'units','normalized','backgroundcolor',color);
pos=[0.03,0.64,0.04,0.08];
showtext(pos,color,'A:');
demo_edita=uicontrol(wind_demo3,'style','edit','pos',[0.08,0.64,0.63,0.08],...
'string','[]','back',[0,0.7,1],'units','normalized');
color=[.9;.9;0.9];
pos=[0.01,0.5,0.22,0.07];
showtext(pos,color,'系統測試結果為:');
color=[.8;.8;0.8];
uicontrol('style','frame','position',[0.025,0.09,.95,.35],...
'units','normalized','backgroundcolor',color);
str=['demoa=eval(get(demo_edita,''string''));',...
'z=eye(size(demoa));',...
'x=lyap(demoa,z);t=0;',...
'for i=1:size(demoa)',...
' if (det(x(1:i,1:i))<0),t=1;break;end;',...
'end;',...
'if (t==1),pos=[0.04,0.22,0.92,0.08];showtext(pos,color,'' 系統不穩定! '');',...
' else,pos=[0.04,0.22,0.92,0.08];showtext(pos,color,''系統漸近穩定!'');',...
'end']
uicontrol(wind_demo3,'style','push','string','Ok',...
'position',[0.78,0.75,0.16,0.11],'units','normalized',...
'callback',str);
uicontrol(wind_demo3,'style','push','string','Close',...
'position',[0.78,0.55,0.16,0.11],'units','normalized',...
'callback','close(wind_demo3)');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -