mdlSetOutputPortDimensionInfo - Set

    the dimensions of the signals accepted by an output port - MATLAB ([original](https://www.mathworks.com/help/simulink/sfg/mdlsetoutputportdimensioninfo.html)) ([raw](?raw))

Main Content

Set the dimensions of the signals accepted by an output port

Syntax

#define MDL_SET_OUTPUT_PORT_DIMENSION_INFO void mdlSetOutputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo)

Arguments

S

SimStruct representing an S-Function block.

port

Index of a port.

dimsInfo

Structure that specifies the signal dimensions supported byport.

See ssSetInputPortDimensionInfo for a description of this structure.

Description

The Simulink® engine calls this method with candidate dimensions dimsInfo for port. In C MEX S-functions, if the proposed dimensions are acceptable, the method sets the actual port dimensions, using [ssSetOutputPortDimensionInfo](sssetoutputportdimensioninfo.html). If they are unacceptable, the method generates an error via [ssSetErrorStatus](ssseterrorstatus.html). This method is only valid for simulation. C MEX S-functions must enclose the method in a #if defined(MATLAB_MEX_FILE) statement.

Note

This method can set the dimensions of any other input or output port whose dimensions derive from the dimensions of port.

By default, the engine calls this method only if it can fully determine the dimensionality of port from the port to which it is connected. In C MEX S-functions, if the engine cannot completely determine the dimensionality from port connectivity, it invokes mdlSetDefaultPortDimensionInfo. If an S-function can fully determine the port dimensionality from partial information, set the option SS_OPTION_ALLOW_PARTIAL_DIMENSIONS_CALL inmdlInitializeSizes, using ssSetOptions. If this option is set, the engine invokesmdlSetOutputPortDimensionInfo even if it can only partially determine the dimensionality of the output port from connectivity.

The engine calls this method until all output ports with inherited dimensions have their dimensions specified.

Examples

See [sfun_matadd.c](https://mdsite.deno.dev/matlab:sfunddg%5Fcb%5Fedit%28'sfun%5Fmatadd'%29;) for an example of how to use this function.

Version History

Introduced before R2006a