abel('y(m)');Рlegend('估计的位置','测量的位置','杂波位置',4)Рfigure %画出目标X轴的估计位置,测量位置Рplot(1:n,x_filter(1,:),'r-'),hold onР%plot(1:n,data_measurement1(1,:),'-')Рplot(data_measurement(1,:),'k-')Р%axis([0 50 1 30])Рxlabel('t(s)'),ylabel('x(m)');Рlegend('X方向估计位置','X方向测量位置',4)Рfigure %画出目标Y轴的估计位置,测量位置Рplot(1:n,x_filter(3,:),'r-'),hold onР%plot(1:n,data_measurement1(3,:),'-')Рplot(data_measurement(2,:),'k-')Р%axis([0 50 1 25])Рxlabel('t(s)'),ylabel('y(m)');Рlegend('Y方向估计位置','Y方向测量位置',4)РfigureРa=zeros(1,n); %最小均方误差Рfor j=1:nРa(1,j)=sqrt((x_filter(1,j)-data_measurement1(1,j))^2+(x_filter(3,j)-data_measurement1(3,j))^2);РendРplot(1:n,a(1,:),'r:')Рxlabel('t(s)'),ylabel('预测误差(m)');РfigureРplot(1:n,x_filter(2,:),'r-'),hold onРplot(1:n,x_filter(4,:),'-');Рxlabel('t(s)'),ylabel('速度(m/s)');Рlegend('X方向速度','Y方向速度',4)