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

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.

 採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日
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".

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by