ssSetInputPortRequiredContiguous
Specify that the signal elements entering a port must be contiguous
Syntax
void ssSetInputPortRequiredContiguous(SimStruct *S, int_T port, int_T flag)
Arguments
SSimStruct that represents an S-Function block.
portIndex of an input port.
flagTrue (
1) if signal elements must be contiguous.
Description
Specifies that the signal elements entering the specified port must occupy
contiguous areas of memory. This allows a method to access the elements of the
signal simply by incrementing the signal pointer returned by
ssGetInputPortSignal. The S-function can set the value of
this attribute as early as in the mdlInitializeSizes method and
at the latest in the mdlSetWorkWidths method.
Note
By default, the flag is set to false
(0), which uses the
ssGetInputPortSignalPtrs function to access
non-contiguous input signals. However, starting in R2026a, S-Function blocks
support only contiguous inputs. Set the flag to true
(1) and use the contiguous input function ssGetInputPortSignal. The
contiguous input functions provide faster access and improved performance by
removing the need for double pointer to access signals.
Languages
C, C++
Examples
See the S-function sfun_io_handling2.c used in sfcndemo_io_handling.
Version History
Introduced before R2006a