?? ex0521.m
字號(hào):
function y=Ex0521(z1)
% EX0521 利用函數(shù)句柄執(zhí)行二階系統(tǒng)時(shí)域響應(yīng)
t=0:0.1:20;
h_plotxy1=str2func('plotxy1') %創(chuàng)建函數(shù)句柄
h_plotxy2=str2func('plotxy2') %創(chuàng)建函數(shù)句柄
h_plotxy3=str2func('plotxy3') %創(chuàng)建函數(shù)句柄
if (z1>=0)&(z1<1)
y=feval(h_plotxy1,z1,t); %執(zhí)行函數(shù)
elseif z1==1
y=feval(h_plotxy2,z1,t); %執(zhí)行函數(shù)
else
y=feval(h_plotxy3,z1,t); %執(zhí)行函數(shù)
end
function y1=plotxy1(zeta,x)
%畫(huà)欠阻尼二階系統(tǒng)時(shí)域曲線
y1=1-1/sqrt(1-zeta^2)*exp(-zeta*x).*sin(sqrt(1-zeta^2)*x+acos(zeta));
plot(x,y1)
function y2=plotxy2(zeta,x)
%畫(huà)臨界阻尼二階系統(tǒng)時(shí)域曲線
y2=1-exp(-x).*(1+x);
plot(x,y2)
function y3=plotxy3(zeta,x)
%畫(huà)過(guò)阻尼二階系統(tǒng)時(shí)域曲線
y3=1-1/(2*sqrt(zeta^2-1))*(exp(-((zeta-sqrt(zeta^2-1))*x))./(zeta-sqrt(zeta^2-1))...
-exp(-((zeta+sqrt(zeta^2-1))*x))./(zeta+sqrt(zeta^2-1)));
plot(x,y3)
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -