https://se.mathworks.com/help/nav/ref/insfiltermarg.residualgps.html
residualgps - Residuals and residual covariance from GPS measurements for insfilterMARG - MATLAB
This MATLAB function computes the residual, res, and the residual covariance, resCov, based on the GPS position measurement and covariance.
residualscovariance