Writing S-Functions | ![]() ![]() |
Set the numeric type (real or complex) of an output port.
Syntax
void ssSetOutputPortComplexSignal(SimStruct *S, input_T port, CSignal_T csig)
Arguments
S
SimStruct representing an S-function block or a Simulink model.
csignal
Numeric type of the signals emitted by port
. Valid values are COMPLEX_NO
(real signal), COMPLEX_YES
(complex signal), COMPLEX_INHERITED
(dynamically determined).
Description
Use this function in mdlInitializeSizes
to initialize input port signal type. If the numeric type of the input port is determined dynamically, e.g., by a parameter setting, set the numeric type to COMPLEX_INHERITED
. The default numeric type of an output port is real.
Languages
Example
Assume that an S-function has three output ports. The first output port emits real (non-complex) signals. The second input port emits a complex signal. The third port emits signals of a type determined by a parameter setting. The following example specifies the correct numeric type for each port.
ssSetOutputPortComplexSignal(S, 0, COMPLEX_NO) ssSetOutputPortComplexSignal(S, 1, COMPLEX_YES) ssSetOutputPortComplexSignal(S, 2, COMPLEX_INHERITED)
See Also
ssGetOutputPortComplexSignal
![]() | ssSetOptions | ssSetOutputPortDataType | ![]() |