Problem in Kalman Filter

3 次查看(过去 30 天)
RUDRAKSH
RUDRAKSH 2016-5-5
编辑: RUDRAKSH 2016-5-5
By following http://www.mu-sigma.com/analytics/pdf/Technical%20Research/Prediction%20using%20Kalman%20Filter.pdf I'm trying to implement kalman filter for prediction. As though i do not have much exposure to kalman flter hence unable to debug what is going wrong.
Can any one help me
Following is the code in matlab:
l = length(PredictionMatrix);
R_K = 1;
H_K = [1];
F_K = [1];
P = eye(length(F_K));
X(1:length(F_K),1) = rand;
V_K(1:length(F_K)) = 10;
Xhat_K(1:length(F_K)) = rand;
Phat_K(1:length(F_K)) = 1;
for i = 2:1:l
Xhat_K(i,1) = F_K*X(i-1);
Phat_K(i,1) = F_K*P*F_K';
V_K(i,1) = PredictionMatrix(i,1) - H_K*Xhat_K(i,1);
Y_K(i,1) = H_K*Xhat_K(i)+V_K(i,1);
S_K = H_K*Phat_K(i)*H_K' +R_K;
W_K = Phat_K(i,1)*H_K'/S_K;
X(i,1) = Xhat_K(i,1)+W_K*V_K(i,1);
P = (Phat_K(i,1)-W_K*S_K*W_K')*P;
end
Xhat_K(i+1) = F_K*X(i);

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 State-Space Control Design and Estimation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by