Main Content

stateinfo

State vector information for insEKF

Description

example

info = stateinfo(filter) returns a structure whose fields contain descriptions of the elements of the state vector in the filter.

example

indices = stateinfo(filter,stateName) returns the indices of the components of the filter state vector corresponding to the specified state name.

example

indices = stateinfo(filter,sensor,stateName) returns the indices of the components of the sensor state vector corresponding to the specified state name.

Examples

collapse all

Create an insGyroscope object and use it to construct an insEKF object.

sensor = insGyroscope;
filt = insEKF(sensor);

Show the information for all the state components.

stateinfo(filt)
ans = struct with fields:
        Orientation: [1 2 3 4]
    AngularVelocity: [5 6 7]
     Gyroscope_Bias: [8 9 10]

Obtain the indices for the orientation state.

stateinfo(filt,"Orientation")
ans = 1×4

     1     2     3     4

Obtain the indices for the sensor bias by using the sensor object input.

stateinfo(filt,sensor,"Bias")
ans = 1×3

     8     9    10

Obtain the indices for the sensor bias directly from the filter.

stateinfo(filt,"Gyroscope_Bias")
ans = 1×3

     8     9    10

Input Arguments

collapse all

INS filter, specified as an insEKF object.

Name of a part of the state for the filter or the sensor, specified as a string scalar or character vector.

Use the stateinfo object function to find the names of state parts in the filter.

Example: "AngularVelocity"

Example: "Bias"

Data Types: char | string

Inertial sensor, specified one of these objects used to construct the insEKF filter object:

Output Arguments

collapse all

State information, returned as a structure. The field names of the structure are names of the elements of the state vector in the filter. The values of each field are the corresponding indices of the state vector.

State indices, returned as an M-element vector of state indices, where M is the dimension of the state part corresponding to the stateName. For example, if the state name corresponds to the first, second, and third elements in the state vector of the filter, then the function returns indices as [1 2 3].

Extended Capabilities

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

Version History

Introduced in R2022a