Here's an example code for implementing a Kalman Filter in Matlab:
main.m930 chars40 lines
This code assumes a linear Gaussian state space model, where the state is 2-dimensional (position and velocity), the measurement is one-dimensional (position only), and the process and measurement noises are Gaussian. The code simulates measurements and performs Kalman filter updates on the state estimate in each time step. The results are then plotted to show how well the filter estimates the true state.
gistlibby LogSnag