Examples
Get Output Index from Operating Point Specification
Open Simulink model.
mdl = 'scdindex1';
mdlpath = fullfile(matlabroot,'examples','slcontrol',mdl);
open_system(mdlpath)
Create an operating point specification for model.
opspec = operspec(mdl);
opspec contains an array of output specifications for the model.
opspec.Outputs
(1.) scdindex1/Out1
spec: none
(2.) scdindex1/Out2
spec: none
Get the index of the output specification for Out2.
idx = getOutputIndex(opspec,'scdindex1/Out2')
idx =
2 1
getOutputIndex