mexPrintf() not working from within mdlStart method of C Mex S-Function

조회 수: 5 (최근 30일)
Chris Morley
Chris Morley 2021년 7월 5일
댓글: Chris Morley 2021년 7월 5일
Hi There,
I'm trying to perform some debugging with a C MEX S-Function in Simulink but both mexPrintf() and ssPrintf() do not print anything to either the command window or the diagnostic viewer when called within the mdlStart method. Both mexPrintf() & ssPrintf() work within the mdlOutputs() & mdlTerminate() methods. Is there another function I should be using to print custom debugging messages from within the mdlStart() method?
static void mdlStart(SimStruct *S)
{
//Both of these following lines fail to print to either command window or diagnostic viewer
mexPrintf("Test test");
ssPrintf("Test text");
}
  댓글 수: 2
Yongjian Feng
Yongjian Feng 2021년 7월 5일
Can you use an external debuger instead? Use gdb or visual studio to attach to the matlab process, and then you can put a break point in this function.
Chris Morley
Chris Morley 2021년 7월 5일
Sorry I'm not well versed with using vdp. Are you suggesting that I use gdp or visual studio to print my text or do you mean I use one of these tools to determine why the text is not printing?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by