Basic Kalman Filter Algorithm - File Exchange - MATLAB Central
for k = 1:N % Prediction with known input x_pred = F * x_est + B * u; P_pred = F * P_est * F' + Q; Basic Kalman Filter Algorithm - File Exchange -
The red dots (measurements) jump around. The blue line (Kalman estimate) follows the green true line much more smoothly. % position = pos + vel*dt
% Matrices A = [1 dt; 0 1]; % position = pos + vel*dt, velocity constant H = [1 0]; % we measure only position Q = [0.01 0; 0 0.01]; % small process noise R = measurement_noise^2; % measurement noise variance velocity constant H = [1 0]
Calculates the new position based on the previous position and speed.