Simulink Control Design™ - MathWorks

(Tuis.) #1

getstatestruct


State structure from operating point

Syntax


x_struct = getstatestruct(op_point)

Description


x_struct = getstatestruct(op_point) extracts a structure of state values,
x_struct, from the operating point object, op_point. The structure, x_struct, uses
the same format as Simulink software which allows you to set initial values for states in
the model within the Data Import/Export pane of the Configuration Parameters dialog
box.

Examples


Create an operating point object for the magball model:

op_magball=operpoint('magball');

Extract a state structure from the operating point object:

states_magball=getstatestruct(op_magball)

This extraction returns

states_magball =

time: 0
signals: [1x5 struct]

To view the values of the states within this structure, use dot-notation to access the
values field:

states_magball.signals.values

15 Alphabetical List

Free download pdf