Main Content

# residualaccel

Residuals and residual covariance from accelerometer measurements for `insfilterAsync`

Since R2020a

## Syntax

``[res,resCov] = residualaccel(FUSE,acceleration,accelerationCovariance)``

## Description

````[res,resCov] = residualaccel(FUSE,acceleration,accelerationCovariance)` computes the residual, `res`, and the residual covariance, `resCov`, based on the acceleration readings and the corresponding covariance.```

example

## Examples

collapse all

`Create` an `insfilterAsync` object and display its state.

```filter = insfilterAsync; disp(filter.State')```
``` 1.0000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 27.5550 -2.4169 -16.0849 0 0 0 ```

Define an accelerometer measurement with its covariance.

`acceleration = [0 -9.8 0] `
```acceleration = 1×3 0 -9.8000 0 ```
`accelCovariance = 0.01*diag([1 1 1]);`

Obtain the residual of the data.

`[res,resCovariance] = residualaccel(filter,acceleration,accelCovariance)`
```res = 1×3 0 -9.8000 -9.8100 ```
```resCovariance = 3×3 0.3969 0 0 0 0.3969 0 0 0 0.3969 ```

## Input Arguments

collapse all

`insfilterAsync`, specified as an object.

Accelerometer readings in local sensor body coordinate system in m/s2, specified as a 3-element row vector

Data Types: `single` | `double`

Acceleration error covariance of the accelerometer measurement in (m/s2)2, specified as a scalar, 3-element row vector, or 3-by-3 matrix.

Data Types: `single` | `double`

## Output Arguments

collapse all

Residual, returned a 1-by-3 vector of real values in m/s2.

Residual covariance, returned a 3-by-3 matrix of real values in (m/s2)2.

## Version History

Introduced in R2020a