所有分类
  • 所有分类
  • 亲子幼儿
  • 小学
  • 初中
  • 高中
  • 状元专栏
  • 升学专区
  • 奥赛专区
  • 大学专区

With Matlab Examples Download Top: Kalman Filter For Beginners

% plot figure; plot(true_traj(1,:), true_traj(2,:), '-k'); hold on; plot(meas(1,:), meas(2,:), '.r'); plot(est(1,:), est(2,:), '-b'); legend('True','Measurements','Estimate'); xlabel('x'); ylabel('y'); axis equal; For nonlinear systems x_k = f(x_k-1,u_k-1) + w, z_k = h(x_k)+v, linearize via Jacobians F and H at current estimate, then apply predict/update with F and H in place of A and H.

dt = 0.1; A = [1 0 dt 0; 0 1 0 dt; 0 0 1 0; 0 0 0 1]; H = [1 0 0 0; 0 1 0 0]; Q = 1e-3 * eye(4); R = 0.05 * eye(2); x = [0;0;1;0.5]; % true initial xhat = [0;0;0;0]; P = eye(4); % plot figure

for k = 1:T w = mvnrnd(zeros(4,1), Q)'; v = mvnrnd(zeros(2,1), R)'; x = A*x + w; z = H*x + v; % Predict xhat_p = A*xhat; P_p = A*P*A' + Q; % Update K = P_p*H'/(H*P_p*H' + R); xhat = xhat_p + K*(z - H*xhat_p); P = (eye(4) - K*H)*P_p; true_traj(:,k) = x; meas(:,k) = z; est(:,k) = xhat; end For nonlinear systems x_k = f(x_k-1

评论0

请先
DOC8.com,高知家庭教育助手,全网唯一深度解析评测原版娃/牛娃/学霸爬藤教育资源和学习资料,K-12爬藤路径个性化定制。特色:美国英国加拿大澳大利亚新加坡中国香港K-12英文原版教材/练习册/分级读物,桥梁/初/中/高章书大全,小升初/中考/高考、雅思IELTS/托福TOEFL/剑桥5级、SAT/ACT/GRE/GMAT、IGCSE/IB/AP/A-Level/DSE考试、全球数学物理化学生物信息学商科竞赛资源!
没有账号?注册  忘记密码?

社交账号快速注册登录