stateVector.variableIndices

Parse the indices of variables in a state vector


Syntax



Description

v = obj.variableIndices(variables)

Parse the indices of variables in a state vector. Error checks logical or linear indices and locates variable names. Returns linear indices to the specified variables. Throws error if variables are an unrecognized type.

v = obj.variableIndices(variables, allowRepeats)

Specify whether variables can include repeated elements. By default, repeated elements are allowed.

v = obj.variableIndices(variables, allowRepeats, header)

Customize the header of thrown error IDs.


Input Arguments

variables

any data type
The input being parsed. If valid, should either be array indices or a list of variable names.

allowRepeats

scalar logical
Set to true to allow repeat variables. Set to false to require unique variables. Default is true.

Output Arguments

indices

vector, linear indices
The indices of the specified variables in the state vector.