# ctrectjac

Jacobian of constant turn-rate rectangular target motion model

## Syntax

``Jx = ctrectjac(state)``
``Jx = ctrectjac(state,dt)``
``[Jx,Jw] = ctrectjac(state,w,dt)``

## Description

````Jx = ctrectjac(state)` returns the Jacobian matrix of the constant turn-rate rectangular motion model with respect to the state vector. The default time step is 1 second.```

example

````Jx = ctrectjac(state,dt)` specifies the time step `dt` in seconds. ```
````[Jx,Jw] = ctrectjac(state,w,dt)` also specifies the process noise `w`. ```

## Examples

collapse all

Define a state vector for the model.

`state = [1;2;2;30;1;4.7;1.8];`

Compute the Jacobian. `dt` = 1 second.

`jac = ctrectjac(state)`
```jac = 7×7 1.0000 0 0.8616 -0.0177 -0.0089 0 0 0 1.0000 0.5075 0.0301 0.0150 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 1.0000 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 ```

Compute the Jacobian. `dt` = 0.1 second without noise.

`jac = ctrectjac(state,0.1)`
```jac = 7×7 1.0000 0 0.0866 -0.0017 -0.0001 0 0 0 1.0000 0.0501 0.0030 0.0002 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 0.1000 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 ```

Compute the Jacobian. `dt` = 0.1 second with noise.

`jac = ctrectjac(state,0.01,0.1)`
```jac = 7×7 1.0000 0 0.0866 -0.0017 -0.0001 0 0 0 1.0000 0.0501 0.0030 0.0002 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 0.1000 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 0 0 0 0 0 0 0 1.0000 ```

## Input Arguments

collapse all

Current state, specified as a 1-by-7 real-valued vector. The sate of the constant-turn rectangular target model is [x; y; s; θ; ω; L; W]. The meaning of these variables and their units are:

 Variable Meaning Unit x Position of the rectangle center in x direction m y Position of the rectangle center in y direction m s Speed in the heading direction m/s θ Orientation angle of the rectangle with respect to x direction degree ω Turn-rate degree/s L Length of the rectangle m W Width of the rectangle m

Example: `[1;2;2;30;1;4.7;1.8]`

Data Types: `single` | `double`

Time step, specified as a real-valued positive scalar in second.

Data Types: `single` | `double`

Process noise, specified as a 2-element real-valued vector. The first element specifies the process noise in linear acceleration (m/s2). The second element specifies the process noise in yaw acceleration (degrees/s2).

Data Types: `single` | `double`

## Output Arguments

collapse all

Jacobian matrix with respect to state, returned as a 7-by-7 matrix.

Data Types: `double`

Jacobian with respect to process noise, returned as a 7-by-2 matrix.

Data Types: `double`

## Version History

Introduced in R2019b