Simulink Coder:防止信号被优化掉
Simulink Coder 往往会将信号优化掉,而这些输出信号不会被保存到 MODEL_NAME_B。
只需将该信号设为测试点(右键点击 -> Properties -> Testpoint):

设为测试点后,即使是这种完全未连接的信号也不会被优化掉:

连接到 MODEL_NAME_A,并将输出信号连接到函数块的输入端。这样可以防止该信号被优化掉。
Check out similar posts by category:
MATLAB/Simulink
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow