Main Content

代码替换

使用代码替换库自定义从模型中生成的代码

使用库针对特定的应用程序或运行时环境优化生成的 C 或 C++ 代码,或者自定义代码以集成所支持运算的现有实现。要快速入门,请参阅什么是代码替换?

工具

代码替换查看器Explore content of code replacement libraries

主题

  • 什么是代码替换?

    为什么以及如何替换代码。MathWorks 提供的代码替换库。代码替换库的内容以及代码生成器如何使用这些内容。术语和限制。

  • Choose a Code Replacement Library

    Explore available code replacement libraries and library content to find a suitable match for your code requirements.

  • 替换从 Simulink 模型生成的代码

    此示例说明如何使用代码替换库替换生成的代码。代码替换是指您可以用来更改代码生成器为函数和运算符生成的代码以满足应用程序代码要求的一种方法。例如,您可以替换生成的代码以满足以下要求:

  • Analyze Code Replacements in Generated Code

    The Code Replacements Report section in the code generation report documents the code replacement library (CRL) functions that were used for code replacements during code generation.