This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Constant velocity state update


updatedstate = constvel(state)
updatedstate = constvel(state,dt)



updatedstate = constvel(state) returns the updated state, state, of a constant-velocity Kalman filter motion model after a one-second time step.


updatedstate = constvel(state,dt) specifies the time step, dt.


collapse all

Update the state of two-dimensional constant-velocity motion for a time interval of one second.

state = [1;1;2;1];
state = constvel(state)
state = 4×1


Update the state of two-dimensional constant-velocity motion for a time interval of 1.5 seconds.

state = [1;1;2;1];
state = constvel(state,1.5)
state = 4×1


Input Arguments

collapse all

Kalman filter state vector for constant-velocity motion, specified as a real-valued 2N-element column vector where N is the number of spatial degrees of freedom of motion. For each spatial degree of motion, the state vector takes the form shown in this table.

Spatial DimensionsState Vector Structure

For example, x represents the x-coordinate and vx represents the velocity in the x-direction. If the motion model is 1-D, values along the y and z axes are assumed to be zero. If the motion model is 2-D, values along the z axis are assumed to be zero. Position coordinates are in meters and velocity coordinates are in meters/sec.

Example: [5;.1;0;-.2;-3;.05]

Data Types: single | double

Time step interval of filter, specified as a positive scalar. Time units are in seconds.

Example: 0.5

Data Types: single | double

Output Arguments

collapse all

Updated state vector, returned as a real-valued vector or real-valued matrix with same number of elements and dimensions as the input state vector.


For a two-dimensional constant-velocity process, the state transition matrix after a time step, T, is block diagonal as shown here.


The block for each spatial dimension is:


For each additional spatial dimension, add an identical block.

Extended Capabilities

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

Introduced in R2018b