How to define the data type of the input port data by ''ssGetOutputPortRealSignal'' ?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block and Blockset Authoring 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!