kalman滤波仿真源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
% modeling data
% sample number N=200 points
% sample time T=0.1s
dt=0.1;
t=0:0.1:20-0.1;
l=length(t);
y=zeros(1,l); %产生全1数组
T=4; % sample time
% v=0.5; % initial velocity
for i=1:l
y(i)=round(round(i/(T/dt))*T);
end
figure(5);
plot(t,y,'-');
% axis([0 20 0 20]);
xlabel('time');
ylabel('yp position');
title('the initial track of movement');
% add white gauss noise
a=0.5*randn(1,200); %产生1*200的随机数矩阵
s=y+a; %data+noise
figure(6);
plot(t,s,'-');
% axis([0 20 0 20]);
xlabel('time');
ylabel('yp position');
title('the track of movement with noise');
save initial_track s y