KalmanFilter
cc_example.m
Go to the documentation of this file.
1 clear all;
2 addpath('..');
3 C = [1, 0.1]; %observation matrix to obtain measurement y (y = C*x + noise)
4 A = [-1,0.2;-0.1,-1]; %(d/dt)x(t) = A*x(t)
5 R_c = [0.1^2]; %continuous sensor noise
6 Q_c = [0.001^2,0;0,0.001^2]; %continuous process noise
7 P_0 = eye(2);%initial covariance
8 
9 %next three variables dictate time step size
10 t_start = 0;
11 t_final = 20;
12 outputs = 10000;
13 
14 covariances = cckf(t_start,t_final,outputs,P_0,A,C,R_c,Q_c);
15 
16 covariances{1}%at t = 0
17 covariances{2000}%at t = 1.999
18 format long;
19 covariances{end}%at t = 19.999
function cckf(in t_start, in t_final, in outputs, in P_0, in A, in C, in R, in Q)