Why am I unable to use the PRINTF function from the standard C libraries inside the wrapper code of my C-MEX S-function?

1 view (last 30 days)
If I use the PRINTF function in my C-MEX S-function it works fine. But if I use this in some wrapper code that is called from my S-function, this function does not work. I have "#included" the standard "stdio.h" library but still have this problem.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
You cannot use PRINTF in wrapper function code. Try using "ssPrintf" which is defined in the simstruc.h file. This will expand to 'mexPrintf' for simulation and 'printf' for real-time code. See "Writing S-functions Guide" page 10-118 for details on this macro.
You should also #include the simstruc.h file in your wrapper code when using "ssPrintf".

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!