xperm

Reorder states in state-space models

Syntax

sys = xperm(sys,P)

Description

sys = xperm(sys,P) reorders the states of the state-space model sys according to the permutation P. The vector P is a permutation of 1:NX, where NX is the number of states in sys. For information about creating state-space models, see ss and dss.

Examples

Order the states in the ssF8 model in alphabetical order.

  1. Load the ssF8 model by typing the following commands:

    load ltiexamples
    ssF8

    These commands return:

    a = 
                    PitchRate    Velocity         AOA  PitchAngle
       PitchRate         -0.7     -0.0458       -12.2           0
       Velocity             0      -0.014     -0.2904      -0.562
       AOA                  1     -0.0057        -1.4           0
       PitchAngle           1           0           0           0
     
    b = 
                   Elevator  Flaperon
       PitchRate      -19.1      -3.1
       Velocity     -0.0119   -0.0096
       AOA            -0.14     -0.72
       PitchAngle         0         0
     
    c = 
                      PitchRate    Velocity         AOA  PitchAngle
       FlightPath             0           0          -1           1
       Acceleration           0           0       0.733           0
     
    d = 
                     Elevator  Flaperon
       FlightPath           0         0
       Acceleration    0.0768    0.1134
     
    Continuous-time model.
  2. Order the states in alphabetical order by typing the following commands:

    [y,P]=sort(ssF8.StateName);
    sys=xperm(ssF8,P)

    These commands return:

    a = 
                          AOA  PitchAngle   PitchRate    Velocity
       AOA               -1.4           0           1     -0.0057
       PitchAngle           0           0           1           0
       PitchRate        -12.2           0        -0.7     -0.0458
       Velocity       -0.2904      -0.562           0      -0.014
     
    b = 
                   Elevator  Flaperon
       AOA            -0.14     -0.72
       PitchAngle         0         0
       PitchRate      -19.1      -3.1
       Velocity     -0.0119   -0.0096
     
    c = 
                            AOA  PitchAngle   PitchRate    Velocity
       FlightPath            -1           1           0           0
       Acceleration       0.733           0           0           0
     
    d = 
                     Elevator  Flaperon
       FlightPath           0         0
       Acceleration    0.0768    0.1134
     
    Continuous-time model.

    The states in ssF8 now appear in alphabetical order.

See Also

|

Was this topic helpful?