Filter löschen
Filter löschen

How to set the dimensions of the inputs with 'mdlSetInp​utPortDime​nsionInfo'

1 Ansicht (letzte 30 Tage)
Hi,I am writing a C S-function for Simulink, with five input ports. The widths of the first 2 ports are set to fixed-sized. The widths of 3rd and 4th ports are set to DYNAMICALLY_SIZED.The width of the last port is 2-D vector . I use the lines in my S-function,but the S-function doesn't run.
Does anyone have an idea on what I am doing wrong, or what might be the solution to this problem ? Should I need to specify the dimension of the input ports separately?
#if defined(MATLAB_MEX_FILE)
#define MDL_SET_INPUT_PORT_DIMENSION_INFO
void mdlSetInputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo) { if (!ssSetInputPortDimensionInfo(S, port, dimsInfo)) return; }
  1. define MDL_SET_OUTPUT_PORT_DIMENSION_INFO
static void mdlSetOutputPortDimensionInfo(SimStruct *S, int_T port, const DimsInfo_T *dimsInfo)
{ if(!ssSetOutputPortDimensionInfo(S, port, dimsInfo)) return;
} #endif

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by