Matlab/Simulink S-Function:如何打印到命令行
在 Matlab/Simulink 中,你可以使用 fprintf(stderr, ...) 打印到 Matlab 启动时的命令行。这对于调试很有用。
至少在我的设置中,stdout 被重定向,因此 printf 不能按预期工作。然而,fprintf(stderr, ...) 工作正常。
sfunction_print_example.c
fprintf(stderr, "Hello S-Function\n");这可以在 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