getStateIndex
Get index of a state element of an operating point specification or operating point
The States property of an operating point specification is an array that contains
trimming specifications for each model state. When defining a mapping function for
customized trimming of Simulink models, getStateIndex lets you obtain the index of a
state specification based on the corresponding block path or state name.
When trimming Simulink models using optimization-based search, some applications
require additional flexibility in defining the optimization search parameters. For such
systems, you can specify custom constraints and a custom objective function. For complex
models, you can define a mapping that selects a subset of the model states, inputs, and
outputs to pass to the custom constraint and objective functions. For more information,
see “Compute Operating Points Using Custom Constraints and Objective Functions” on
page 1-78.
Syntax
index = getStateIndex(op,name)
index = getStateIndex(op,name,element)
Description
index = getStateIndex(op,name) returns the index of the state specification that
corresponds to name in the States property of operating point specification op.
index = getStateIndex(op,name,element) returns the index of the specified
element within a state specification for a block with multiple states.
Examples
Get State Index from Operating Point Specification
Open Simulink model.
15 Alphabetical List