index1 = getStateIndex(opspec,'scdindex1/system1')
index1 =
1 1
1 2
1 3
Each row of index1 contains the index of one state in the system2 block. For each row,
the first column contains the index of the state specification in opspec.States. The
second column contains the index of each state element within the specification.
Get Index of Specified State Element of Operating Point Specification
Open Simulink model.
mdl = 'scdindex1';
mdlpath = fullfile(matlabroot,'examples','slcontrol',mdl);
open_system(mdlpath)
Create an operating point specification for the model.
opspec = operspec(mdl);
If a block has multiple states, you can obtain the index of a specific state within the
corresponding state specification by specifying the element index. For example, get the
index for the second state in the specification for the system1 block.
index1 = getStateIndex(opspec,'scdindex1/system1',2)
15 Alphabetical List