主要内容

减少数据副本

调整模型参数以提高代码执行速度并减少内存使用量

通过消除生成的代码中的数据副本,减少 RAM 和 ROM 消耗并提高代码执行速度。代码生成器会消除一些数据副本。通过调整某些模型参数设置、为 MATLAB Function 模块的输入和输出参量指定相同的名称,以及使用 Simulink 信号指定重用,您可以消除其他数据副本。

模型设置

内联不变信号在生成的代码中转换不变信号的符号名称
消除多余的局部变量(表达式折叠)指定将表达式折叠成单个表达式
用户函数之间的函数内联Control inlining for calls from user-written functions to other user-written functions (自 R2025a 起)
MathWorks 函数之间的函数内联Control inlining for calls from MathWorks functions to other MathWorks functions (自 R2025a 起)
用户函数和 MathWorks 函数之间的函数内联Control inlining for calls from user-written functions to MathWorks functions and from MathWorks functions to user-written functions (自 R2025a 起)

主题