Writing S-Functions    
mdlSetOutputPortDimensionInfo

Set the dimensions of the signals accepted by an output port.

Syntax

Arguments

S
   SimStruct representing an S-Function block or a Simulink model.

port
   Index of a port.

dimsInfo
   Structure that specifies the signal dimensions supported by port.

See ssSetInputPortDimensionInfo for a description of this structure.

Description

Simulink calls this method with candidate dimensions dimsInfo for port. If the proposed dimensions are acceptable, this method should go ahead and set the actual port dimensions, using ssSetOutputPortDimensionInfo. If they are unacceptable, this method should generate an error via ssSetErrorStatus.

By default, Simulink calls this method only if it can fully determine the dimensionality of port from the port to which it is connected. If it cannot completely determine the dimensionality from port connectivity, it invokes mdlSetDefaultPortDimensionInfo. If an S-function can fully determine the port dimensionality from partial information, the function should set the option SS_OPTION_ALLOW_PARTIAL_DIMENSIONS_CALL in mdlInitializeSizes, using ssSetOptions. If this option is set, Simulink invokes mdlSetOutputPortDimensionInfo even if it can only partially determine the dimensionality of the input port from connectivity.

Languages

C

Example

See matlabroot/simulink/src/sfun_matadd.c for an example of how to use this function.

See Also

ssSetOutputPortDimensionInfo, ssSetErrorStatus


  mdlSetOutputPortDataType mdlSetOutputPortSampleTime