stateVector.length

Return the length of a state vector or variables in the vector


Syntax



Description

length = obj.length
length = obj.length(0)

Return the number of elements in the state vector.

lengths = obj.length(-1)

Return the number of elements for each variable in the state vector.

lengths = obj.length(v)
lengths = obj.length(variableNames)

Return the number of elements for the specified variables in the state vector.


Input Arguments

v

logical vector | vector, linear indices | 0 | -1
The indices of the variables for which to return state vector lengths. If 0, returns the length of the entire state vector. If -1, returns the lengths of every variable in the state vector.

variableNames

string vector
The names of the variables in the state vector for for which to return state vector lengths

Output Arguments

length

scalar positive integer
The number of elements in the state vector.

lengths

vector, positive integers
The number of state vector elements for each of the specified variables.