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!