printf in mdlTerminate (mex S-function/simulink)

Hi,
I have a custom simulink block with some c++ code. Printf works fine in mldUpdate and mdlOutputs but its not working in mdlStart and mdlTerminate. Mex compiles successfully but there is nothing printed in the console. Is it even possible to use printf in those parts of the code?
Example:
static void mdlTerminate(SimStruct *S)
{
printf("Packets in queue:%i\n",queue_packets);
printf("bjkfdsaj");
fflush(stdout);
//cleanup
closesocket(sReceive);
closesocket(sSend);
WSACleanup();
}
EDIT: using R2014b

답변 (0개)

카테고리

도움말 센터File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

질문:

2016년 5월 9일

편집:

2016년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by