Matlab/Simulink S-Function: How to print to the command line
In Matlab/Simulink, you can print to the command line where Matlab was started using fprintf(stderr, ...). This is useful for debugging purposes.
At least in my setup, stdout is redirected, so printf does not work as expected. However, fprintf(stderr, ...) works fine.
sfunction_print_example.c
fprintf(stderr, "Hello S-Function\n");This can be used anywhere in the S-function.
Check out similar posts by category:
Matlab/Simulink, C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow