I am using a MATLAB Function block in my Simulink model. My MATLAB function calls a custom C functions using "coder.ceval". I want to use "mexPrintf" in my C function during simulation but the standard C "printf" when building the model. How can I do this?
MATLAB: How to use “mexPrintf” for simulation and “printf” for code generation in a MATLAB Function Block using coder.ceval
codegencodermacroMATLABmatlab_mex_filemexmexprintfprintfsimulinksimulink coderstdout
Best Answer