Main Content

getinputstruct

Obtain input values from operating point

Description

u = getinputstruct(op) extracts a structure of input values from a specified operating point object. You can use the input structure to set initial input values for your Simulink® model.

example

Examples

collapse all

Open the scdplane model and create an operating point. You can also compute a trimmed operating point or obtain an operating point snapshot.

mdl = 'scdplane';
open_system(mdl)
op = operpoint(mdl);

Extract the state values from the operating point.

xInitial = getstatestruct(op);

Extract the input values from the operating point.

uInitial = getinputstruct(op);

To view the values of the states or inputs within this structure, use dot notation. For example, view the input values.

uInitial.signals.values
ans = 
0

Set the initial state values in the model.

set_param(mdl,'LoadInitialState','on','InitialState','xInitial')

Set the initial input values in the model.

set_param(mdl,'LoadExternalInput','on','ExternalInput','uInitial')

Input Arguments

collapse all

Operating point for a Simulink model, specified as an OperatingPoint, OperatingSpec, or OperatingReport object. You can also specify a homogeneous array of any of these objects.

Output Arguments

collapse all

Input values, returned as a structure with the following fields.

  • signals — Input values and information

  • time — Simulation time for input values, returned as 0.

If op is an array, u is returned as a structure array with the same dimensions as op.

Version History

Introduced before R2006a