In addition to root-level outputs of a model, the opspec.Outputs array contains
specifications for trim constraints added to signals using the addoutputspec command.
Add an output specification to the signal originating from second output port of the
Aircraft Dynamics Model block.
opspec = addoutputspec(opspec,'scdplane/Aircraft Dynamics Model',2);
View the output array of opspec.
opspec.Outputs
(1.) scdplane/alpha (rad)
spec: none
(2.) scdplane/Nz Pilot (g)
spec: none
(3.) scdplane/Aircraft Dynamics Model
spec: none
Get the index of the added output specification. When there is an output specification for
only one of the output ports of a given block, you do not need to specify the port number
to get the output index.
index1 = getOutputIndex(opspec,'scdplane/Aircraft Dynamics Model')
index1 =
3 1
Add an output specification to the signal originating from the first output of the same
block.
opspec = addoutputspec(opspec,'scdplane/Aircraft Dynamics Model',1);
View the output array of opspec.
opspec.Outputs
(1.) scdplane/alpha (rad)
spec: none
(2.) scdplane/Nz Pilot (g)
spec: none
(3.) scdplane/Aircraft Dynamics Model
getOutputIndex