https://se.mathworks.com/help/control/ref/statespacemodel.xperm.html
xperm - Reorder states in state-space models - MATLAB
This MATLAB function reorders the states of the state-space model sys according to the permutation P.
state space modelsreorderstatesmatlab