Reorder states in state-space models.
Inputs
State-space model.
Vector containing the state indices in the desired order.
Alternatively, a cell vector containing the state names
is possible as well. See sys.stname
. State names
only work if they were assigned explicitly before, i.e.
sys.stname
contains no empty strings.
Note that if certain state indices of sys are
missing or appear multiple times in idx, these
states will be pruned or duplicated accordingly in the
resulting state-space model retsys.
Outputs
Resulting state-space model with states reordered according to idx.
Package: control