📄 ch4_2.m
字号:
clear
load y2data;
n=length(y2);
for i=5:n
th=ar(y2(1:i),2);
a0 = arxdata(th);
a(i)=a0(2);
b(i)=a0(3);
th1=ar(a(1:i)',2);
a1 = arxdata(th1);
aa(i)=a1(2);
bb(i)=a1(3);
th2=ar(b(1:i)',2);
a2 = arxdata(th2);
aaa(i)=a2(2);
bbb(i)=a2(3);
end
for i=2:n-1
ap(i+1)=aa(i)*a(i)+bb(i)*a(i-1);
bp(i+1)=aaa(i)*b(i)+bbb(i)*b(i-1);
y(i+1)=ap(i+1)*y2(i)+bp(i+1)*y2(i-1);
yy(i+1)=-a(i)*y2(i)-b(i)*y2(i-1);
end
t=[1:n]';
figure(1)
subplot(211)
plot(t,a,'r-', t,b,'b-')
subplot(212)
plot(t,y2,'r-',t,y,'b-',t,yy,'g-')
figure(2)
subplot(211)
plot(t,a,'r-', t,aa,'b-',t,aaa,'y-')
subplot(212)
plot(t,b,'r-', t,bb,'b-',t,bbb,'y-')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -