Main Content


Predict state estimates forward in time for insEKF



[state,stateCovariance] = predict(filter,dt) predicts the state estimates forward in time by dt seconds based on the motion model of the filter and returns the predicted state and state estimate error covariance.

[___] = predict(___,varargin) specifies arguments used in the state transition functions or state transition Jacobian functions of the sensor models or the motion model used in the filter, in addition to all arguments from the previous syntax.


collapse all

Create an insEKF filter object. Specify the angular velocity of filter as [.1 0 0] rad/s.

filter = insEKF;
stateparts(filter,"AngularVelocity",[.1 0 0]);

Show the orientation quaternion at time t = 0 seconds.

orientation0 = quaternion(stateparts(filter,"Orientation"))
orientation0 = quaternion
     1 + 0i + 0j + 0k

Predict the filter by 1 second and show the orientation quaternion.

[state, statecov] = predict(filter,1);
orientation1 = quaternion(stateparts(filter,"Orientation"))
orientation1 = quaternion
      0.99875 + 0.049938i +        0j +        0k

Input Arguments

collapse all

INS filter, specified as an insEKF object.

Time step of prediction, specified as a positive scalar.

Data Types: single | double

Additional arguments passed to the state transition functions and state transition Jacobian functions of the motion model and sensor models used in the filter, specified as any data type accepted by the two functions. You can use these arguments to simulate control or drive inputs, such as a throttle.

Data Types: single | double

Output Arguments

collapse all

Predicted state vector, returned as an N-element real-valued vector, where N is the dimension of the filter state.

Data Types: single | double

State estimate error covariance, returned as an N-by-N real-valued positive definite matrix, where N is the dimension of the state.

Data Types: single | double

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced in R2022a