資源簡介
利用matlab實現(xiàn)的簡單的基于卡爾曼濾波的跟蹤算法

代碼片段和文件信息
%incremental?algorithm
%C--balance?parameter
%z--the?weight?vector?of?SVM
%u--the?output?of?SVM
clc;
clear;
N=100;
e=0.1:10/100:10;
xe=sin(e);
y=2*xe;
cita=2;
d=1;
C=zeros(NN+1);
z=zeros(N+1N+1);
z(:1)=0.01*ones(N+11);
%?z(:1)=randn(N+11)/250;
R=1.001*eye(N+1N+1);%?covariant
ee=zeros(N1);
Q=1.1;???????????%?covariant
I=eye(N+1N+1);
P=1000000.01*eye(N+1N+1);
yy=zeros(N1);
for?i=1:N
????uk(i)=d*exp(-cita*((xe(i)-xe(1))*(xe(i)-xe(1))));
end
C(1:)=[1uk];
G=(P‘+R)*C(1:)‘*inv(C(1:)*P*C(1:)‘+Q);
P=(I-G*C(1:))*(P‘+R);
for?j=1:N-1
?????ee(j)=yy(j)-y(j);
?????for?i=1:N
?????????K(i)=d*exp(-cita*((xe(i)-xe(j))^2));%+(ee(i)-ee(j))^2));
?????end
%?????R=0.9*P;?
????C(j+1:)=[1K];
????G=(P‘+R)*C(j:)‘*inv(Q+C(j:)*(P‘+R)*C(j:)‘);????????%gain?matrix
????z(:j+1)=z(:j)+G*(y(j)-C(j:)*z(:j));
????P=(I-G*C(j:))*(P‘+R);
????yy(j+1)=C(j+1:)*z(:j+1);
end
sume=ee‘*ee
figure;
plot(yy‘r‘);
hold?on
plot(y‘k‘);
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????971??2005-03-04?16:04??trail_kal.m
-----------?---------??----------?-----??----
??????????????????971????????????????????1
評論
共有 條評論