ir , one matlab code from a discussion helped me to do my work,Now I need to get the gain equation of kalman filter ,to compare the code .
K(1:5,k)=sig(1:5,5*k-29:5*k-25)*F(1:5,k)*inv(F(1:5,k)'*sig(1:5,5*k-29:5*k-25)*F(1:5,k)+R); %Kalman Gain
sig(1:5,5*k-24:5*k-20)=sig(1:5,5*k-29:5*k-25)-sig(1:5,5*k-29:5*k-25)*F(1:5,k)*inv(F(1:5,k)'*sig(1:5,5*k-29:5*k-25)*F(1:5,k) +R)*(F(1:5,k)'*sig(1:5,5*k-29:5*k-25))+Q; % error covariance matrix
these are the code for gain and covariance matrix . can you help me ?