How to set the dimensions of the inputs with 'mdlSetInputPortDimensionInfo'
조회 수: 1 (최근 30일)
이전 댓글 표시
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; }
- 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
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!