?? matlab自適應(yīng)進(jìn)行信號(hào)預(yù)測.txt
字號(hào):
自適應(yīng)進(jìn)行信號(hào)預(yù)測2007/06/03 00:16%分別定義兩段時(shí)間Time1和Time2,對(duì)應(yīng)信號(hào)的不同頻率時(shí)段
Time1=0:0.05:4;
Time2=4.05:0.024:6;
Time=[Time1 Time2];
%得到待預(yù)測的目標(biāo)信號(hào)
T=[cos(Time1*4*pi) cos(Time2*8*pi)];
T=con2seq(T);
%繪出目標(biāo)信號(hào)的曲線,并指定給輸入
figure;
plot(Time,cat(2,T{:}));
xlabel('時(shí)間');
ylabel('目標(biāo)');
title('待跟蹤的目標(biāo)信號(hào)');
P=T;
%生成線性網(wǎng)絡(luò)
lr=0.1;
delays = [1 2 3 4 5];
net = newlin(minmax(cat(2,P{:})),1,delays,lr);
%對(duì)網(wǎng)絡(luò)進(jìn)行自適應(yīng)訓(xùn)練
[net,a,e]=adapt(net,P,T);
%繪出預(yù)測信號(hào)、目標(biāo)信號(hào)及誤差信號(hào)曲線
figure;
plot(Time,cat(2,a{:}),Time,cat(2,P{:}),'--');
xlabel('時(shí)間');
ylabel('目標(biāo)、預(yù)測值');
title('目標(biāo)信號(hào)及預(yù)測結(jié)果');
figure;
plot(Time,cat(2,e{:}));
xlabel('時(shí)間');
ylabel('誤差');
title('誤差信號(hào)');
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -