| Contents | Index |
int_T ssSetOutputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo)
SimStruct representing an S-Function block.
Index of an output port.
Structure of type DimsInfo_T that specifies the dimensionality of the signals emitted by port.
See ssSetInputPortDimensionInfo for a description of this structure.
1 if successful; otherwise, 0.
Specifies the dimension information for port. Use this function in mdlInitializeSizes to initialize the output port dimension information. If you want the port to inherit its dimensionality from the block to which it is connected, specify DYNAMIC_DIMENSION as the dimsInfo for port. In this case, the S-function must provide mdlSetOutputPortDimensionInfo and mdlSetDefaultPortDimensionInfo methods to enable the signal dimensions to be set correctly during signal propagation.
C, C++
The following example specifies that output port 0 emits 2-by-2 matrix signals.
DECL_AND_INIT_DIMSINFO(di); int_T dims[2]; di.numDims = 2; dims[0] = 2; dims[1] = 2; di.dims = dims; di.width = 4; ssSetOutputPortDimensionInfo(S, 0, &di);
See the S-function sfun_matadd.c used in sfcndemo_matadd.mdl for a complete example that uses this function.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |