function [xk_hat,Pk] = EKF_estimation(f_EKF,JacFx,h_EKF,JacHx,ymeas,xk_hat,uEKF,Pk,Qk,Rk)

nxEKF = numel(xk_hat);

Fj = full(JacFx(xk_hat,uEKF));

xk_hat_1 =  full(f_EKF(xk_hat,uEKF));
Pk_1 = Fj*Pk*Fj' + Qk;

Hj = full(JacHx(xk_hat_1,uEKF));
ek = full(ymeas - h_EKF(xk_hat_1,uEKF));
Sk = Hj*Pk_1*Hj' + Rk;
Kk = (Pk_1*Hj')/(Sk);
xk_hat = xk_hat_1 + Kk*ek;
Pk = (eye(nxEKF) - Kk*Hj)*Pk_1;


end