新建 文本文档.txt

来自「卡尔曼滤波的MATLAB程序,卡尔曼滤波的MATLAB程序」· 文本 代码 · 共 4,977 行 · 第 1/5 页

TXT
4,977
字号
kalman 滤波的 matlab 程序 



clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1:N; 
clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1:N; 
clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv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 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1:N; 
clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1:N; 
clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2;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); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1:N; 
clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1:N; 
clear 
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 
q2=std(x); 
Rxx=q2.^2; 
q3=std(w); 
Rww=q3.^2; 
c=0.2; 
Y=c*x+V; 

p(1)=0; 
s(1)=0; 
for t=2:N; 
p1(t)=a.^2*p(t-1)+Rww; 
b(t)=c*p1(t)/(c.^2*p1(t)+Rvv); 
s(t)=a*s(t-1)+b(t)*(Y(t)-a*c*s(t-1)); 
p(t)=p1(t)-c*b(t)*p1(t); 
end 

t=1
N=200; 
w(1)=0; 
w=randn(1,N) 
x(1)=0; 
a=1; 
for k=2:N; 
x(k)=a*x(k-1)+w(k-1); 
end 

V=randn(1,N); 
q1=std(V); 
Rvv=q1.^2; 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?