Main Content


Residuals and residual covariances from direct state measurements for insfilterMARG


[res, resCov]= residual(FUSE,idx,measurement,measurementCovariance) computes the residual, res, and the residual covariance, resCov, based on the direct state measurement and measurement covariance. The measurement maps directly to the states specified by indices, idx.

Input Arguments

collapse all

insfilterMARG, specified as an object.

State vector index of measurement, specified as an N-element vector of increasing integers in the range [1, 22].

The state values represent:

Orientation (quaternion parts) 1:4
Position (NED)m5:7
Velocity (NED)m/s8:10
Delta Angle Bias (XYZ)rad11:13
Delta Velocity Bias (XYZ)m/s14:16
Geomagnetic Field Vector (NED)µT17:19
Magnetometer Bias (XYZ)µT20:22

Direct measurement of state, specified as a N-element vector. N is the number of elements of the index argument, idx.

Covariance of measurement, specified as an N-by-N matrix. N is the number of elements of the index argument, idx.

Output Arguments

collapse all

Measurement residual, returned as a 1-by-N vector of real values.

Residual covariance, returned as a N-by-N matrix of real values.

Introduced in R2020a