精选优质文档-倾情为你奉上% EKF UKF PF三种算法对比clcclose allclear;% tic;x = 0.1; % 初始状态 x_estimate = 1;%状态的估计e_x_estimate = x_estimate; %EKF的初始估计u_x_estimate = x_estimate; %UKF的初始估计p_x_estimate = x_estimate; %PF的初始估计Q = 10;%input(请输入过程噪声方差Q的值: ); % 过程状态协方差 R = 1;%input(请输入测量噪声方差R的值: ); % 测量噪声协方差 P =5;%初始估计方差e_P = P; %UKF方差u_P = P;%UKF方差pf_P = P;%PF方差tf = 50; % 模拟长度 x_array = x;%真实值数组e_x_estimate_array = e_x_estimate;%EKF最优估计值数组u_x_estimate_array = u_x_esti