This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Get pointers to an input port's signal elements


InputPtrsType ssGetInputPortSignalPtrs(SimStruct *S, int_T port)



SimStruct representing an S-Function block.


Index of an input port.


Pointer to an array of signal element pointers for the specified input port.


Use to obtain pointers to an input port's signal elements. If the input port width is 5, this function returns a pointer to a 5-element pointer array. Each element in the pointer array points to the specific element of the input signal.

You must use ssGetInputPortRealSignalPtrs to get pointers to signals of type double (real_T).

Use this function only for non-contiguous input. If you have contiguous input, use the ssGetInputPortSignal function.

    Note   The ssGetInputPortSignalPtrs macro becomes a function when you compile your S-function in debug mode (mex -g).


C, C++


Assume that the input port data types are int8_T.

  int_T nInputPorts = ssGetNumInputPorts(S);
  for (i = 0; i < nInputPorts; i++) {
  InputPtrsType      u     = ssGetInputPortSignalPtrs(S,i);
  InputInt8PtrsType  uPtrs = (InputInt8PtrsType)u;
  int_T              nu    = ssGetInputPortWidth(S,i);
  for (j = 0; j < nu; j++) {
      /* uPtrs[j] is an int8_T pointer that points to the j-th  
         element of the input signal. 

See the S-function sfun_dtype_io.c used in sfcndemo_dtype_io for a complete example that uses this function.

Introduced before R2006a

Was this topic helpful?