Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Contents

mdlSetOutputPortComplexSignal

Set the numeric types (real, complex, or inherited) of the signals accepted by an output port

Required

No

Languages

C, C++

Syntax

#define MDL_SET_OUTPUT_PORT_COMPLEX_SIGNAL
void mdlSetOutputPortComplexSignal(SimStruct *S, int_T port, 
 CSignal_T csig)

Arguments

S

SimStruct representing an S-Function block.

port

Index of a port.

csig

Numeric type of signal, either COMPLEX_NO (real) or COMPLEX_YES (complex).

Description

The Simulink® engine calls this routine to set the output port numeric type for outputs that have this attribute set to COMPLEX_INHERITED. The input argument csig is the proposed numeric type for this output port. The S-function must check whether the specified numeric type is a valid type for the specified port.

If it is valid, C MEX S-functions set the numeric type of the specified output port using ssSetOutputPortComplexSignal. Otherwise, the S-function reports an error, using ssSetErrorStatus. This method is only valid for simulation. C MEX S-functions must enclose the method in a #if defined(MATLAB_MEX_FILE) statement.

The S-function can also set the numeric types of other input and output ports with unknown numeric types. The engine reports an error if the S-function changes the numeric type of a port whose numeric type is known.

If the S-function does not implement this routine, the engine assumes that the S-function accepts a real or complex signal and sets the output port numeric type to the specified value.

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

Example

See sdotproduct.csdotproduct.c for an example of how to use this function.

Was this topic helpful?