switchimm
Model conversion function for
objecttrackingIMM
Syntax
Description
State Conversion
converts the state2 = switchimm(modelType1,state1,modelType2)State specified in state1, from
modelType1 state definition to modelType2
state definition.
modelType1–– Specifies the string name of the current motion model.state1–– Specifies theStatecorresponding tomodelType1.modelType2–– Specifies the string name of the motion model to whichstate1needs to be converted.
additionally lets you specify the dimensionality and data type of the output. When not
specified, state2 = switchimm(___,outputFormat)state2 has the same dimensionality and data type as
state1.
Linear State Covariance Conversion
converts the stateCov2 = switchimm(modelType1,stateCov1,modelType2)StateCovariance specified in
stateCov1, from modelType1 state definition to
modelType2 state definition. The conversion between
modelType1 and modelType2 must be linear.
modelType1–– Specifies the string name of the current motion model.stateCov1–– Specifies theStateCovariancecorresponding tomodelType1.modelType2–– Specifies the string name of the motion model to whichstateCov1needs to be converted.
additionally lets you specify the dimensionality and data type of the output. When not
specified, stateCov2 = switchimm(___,outputFormat)stateCov2 has the same dimensionality and data type as
stateCov1.
Nonlinear State Covariance Conversion
enables nonlinear conversion of stateCov2 = switchimm(modelType1,stateCov1,modelType2,outputFormat,state1)StateCovariance between motion model
definitions, such as between constacc and ctrv. The
nonlinear conversion of state covariance requires both the current state,
state1, and the state covariance, stateCov1,
as inputs.
modelType1–– Specifies the string name of the current motion model.stateCov1–– Specifies theStateCovariancecorresponding tomodelType1.modelType2–– Specifies the string name of the motion model to whichstateCov1needs to be converted.outputFormat–– Specifies the dimensionality and data type of the output.state1–– Specifies theStatecorresponding tomodelType1.
(since R2024b)