mdlSetInputPortDimensionInfo
Set the dimensions of the signals accepted by an input port
Required
No
语言
C, C++
Syntax
#define MDL_SET_INPUT_PORT_DIMENSION_INFOvoid mdlSetInputPortDimensionInfo(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 by the port.
SeessSetInputPortDimensionInfo
for a description of this structure.
Description
The Simulink®engine calls this method during dimension propagation with candidate dimensionsdimsInfo
forport
.In C MEX S-functions, if the proposed dimensions are acceptable, the method sets the actual port dimensions, using
.If they are unacceptable, the method generates an error viassSetInputPortDimensionInfo
.ssSetErrorStatus
This method is only valid for simulation. A C MEX S-function 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 ofport
.
By default, the engine calls this method only if it can fully determine the dimensionality ofport
from the port to which it is connected. For C MEX S-functions, if the engine cannot completely determine the dimensionality from port connectivity, it invokesmdlSetDefaultPortDimensionInfo
.If an S-function can fully determine the port dimensionality from partial information, set the optionSS_OPTION_ALLOW_PARTIAL_DIMENSIONS_CALL
inmdlInitializeSizes
, usingssSetOptions
.If this option is set, the engine invokesmdlSetInputPortDimensionInfo
even if it can only partially determine the dimensionality of the input port from connectivity.
The engine calls this method until all input ports with inherited dimensions have their dimensions specified.
Example
Seesfun_matadd.c
for an example of how to use this function.