?? ste.m
字號:
function [sigma,tp,ts]=ste(y,t) %函數定義
[mp,tf]=max(y);
cs=length(t);
yss=y(cs);
sigma=(mp-yss)/yss %計算超調量
tp=t(tf) %計算峰值時間
%計算調節時間
i=cs+1;n=0;
while n==0,
i=i-1;
if i==1,
n=1;
elseif y(i)>1.05*yss,
n=1;
end;
end;
t1=t(i);cs=length(t);j=cs+1;
n=0;
while n==0,
j=j-1;
if j==1,
n=1;
elseif y(j)<0.95*yss, %選擇5%的誤差帶
n=1;
end;
end;
t2=t(j);
if t2<tp
if t1>t2
ts=t1
end
elseif t2>tp,
if t2<t1,
ts=t2
else
ts=t1
end
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -