Writing S-Functions | ![]() ![]() |
Set the dimensions of the signals accepted by an input port.
Syntax
Arguments
S
SimStruct representing an S-Function block.
dimsInfo
Structure that specifies the signal dimensions supported by port
.
See ssSetInputPortDimensionInfo for a description of this structure.
Description
Simulink calls this method during dimension propagation with candidate dimensions dimsInfo
for port
. If the proposed dimensions are acceptable, this method should go ahead and set the actual port dimensions, using ssSetInputPortDimensionInfo
. If they are unacceptable, this method should generate an error via ssSetErrorStatus
.
Note
This method can set the dimensions of any other input or output port whose dimensions derive from the dimensions of port .
|
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 mdlSetInputPortDimensionInfo
even if it can only partially determine the dimensionality of the input port from connectivity.
Languages
Example
See matlabroot/simulink/src/sfun_matadd.c
for an example of how to use this function.
See Also
![]() | mdlSetInputPortDataType | mdlSetInputPortFrameData | ![]() |