Documentation

Signal Access

Configure signal access for input and output ports

S-Function Callback Methods

mdlInitializeSizesSpecify the number of inputs, outputs, states, parameters, and other characteristics of the C MEX S-function
mdlOutputsCompute the signals that this block emits
mdlSetWorkWidthsSpecify the sizes of the work vectors and create the run-time parameters required by this C MEX S-function

SimStruct Functions

ssGetNumInputPortsGet the number of input ports that a block has
ssGetNumOutputPortsGet the number of output ports that a block has
ssGetInputPortBufferDstPortDetermine the output port that is sharing this input port's buffer
ssGetInputPortConnectedDetermine whether a port is connected to a nonvirtual block
ssGetInputPortOptimOptsGet the reusability setting of the memory allocated to the input port of an S-function
ssGetInputPortOverWritableDetermine whether an input port can be overwritten
ssGetInputPortRealSignalGet the address of a real, contiguous signal entering an input port
ssGetInputPortRealSignalPtrsGet pointers to signals of type double connected to an input port
ssGetInputPortSignalGet the address of a contiguous signal entering an input port
ssGetInputPortSignalPtrsGet pointers to an input port's signal elements
ssGetOutputPortConnectedDetermine whether an output port is connected to a nonvirtual block
ssGetOutputPortBeingMergedDetermine whether the output of this block is connected to a Merge block
ssGetOutputPortOptimOptsGet the reusability setting of the memory allocated to the output port of an S-function
ssGetOutputPortRealSignalGet a pointer to an output signal of type double (real_T)
ssGetOutputPortSignalGet the vector of signal elements emitted by an output port
ssSetInputPortOptimOptsSpecify reusability of the memory allocated to the input port of an S-function
ssSetInputPortOverWritableSpecify whether one of an S-function's input ports can be overwritten by one of its output ports
ssSetOutputPortOptimOptsSpecify reusability of the memory allocated to the output port of an S-function
ssSetOutputPortOverwritesInputPortSpecify whether an output port can share its memory buffer with an input port

Examples and How To

Input and Output Ports

How to create input and output ports on an S-function block.

Concepts

S-Function Callback Methods

Description of S-function callback methods

S-Function SimStruct Functions

Overview of SimStruct macros and functions.

Was this topic helpful?