getxu

States and inputs from operating points

Syntax

x = getxu(op)
[x,u] = getxu(op)
[x,u,xstruct] = getxu(op)

Description

x = getxu(op) extracts a vector of state values, x, from the operating point object, op.

[x,u] = getxu(op) also extracts a vector of input values, u, from the operating point object. The ordering of inputs in u corresponds to the root-level input port numbering in Simulink®.

[x,u,xstruct] = getxu(op) also extracts a structure of state values, xstruct, from the operating point object. The structure of state values, xstruct, has the same format as that returned from a Simulink simulation.

Examples

collapse all

Create an operating point for the magball model.

op = operpoint('magball');

View the states in the operating point.

op.States
(1.) magball/Controller/PID Controller/Filter/Cont. Filter/Filter
      x: 0            
(2.) magball/Controller/PID Controller/Integrator/Continuous/Integrator
      x: 14           
(3.) magball/Magnetic Ball Plant/Current
      x: 7            
(4.) magball/Magnetic Ball Plant/dhdt
      x: 0            
(5.) magball/Magnetic Ball Plant/height
      x: 0.05         

Extract vectors of state and input values and a state structure from the operating point.

[x,u,xstruct] = getxu(op)
x = 5×1

    0.0500
         0
   14.0071
    7.0036
         0

u =

     []
xstruct = struct with fields:
       time: 0
    signals: [1x5 struct]

View the states within the state structure.

xstruct.signals
ans=1×5 struct array with fields:
    values
    dimensions
    label
    blockName
    stateName
    inReferencedModel
    sampleTime

The values field shows the state values for the operating point. The blockName field shows the names of the block that contain each state.

Introduced before R2006a