How to define the data type of the input port data by ''ssGetOutputPortRealSignal'' ?
이전 댓글 표시
In the S-function, the default data type of the output port is SS_DOUBLE. I want to define the data type to SS_SINGLE.I write the lines as follows,but the displaying of the output data is error!I want to know why the result is wrong and I should how to define the data type. Thank you!
static void mdlOutputs(SimStruct *S, int_T tid) { real32_T *y1 = ssGetOutputPortRealSignal(S,0); real_T *y2 = ssGetOutputPortRealSignal(S,1);
int_T in1 = ssGetInputPortWidth(S,0);
int_T in2 = ssGetInputPortWidth(S,1);
int_T in3 = ssGetInputPortWidth(S,2);InputPtrsType x = ssGetInputPortRealSignalPtrs(S,2);
real32_T *value_y = x[0];
y1[0] = value_y[0] ;
y1[1] = in2;
y1[2] = in3; y2[0] = in1;
y2[1] = in2;}
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Configure C/C++ S-Function Features에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!