配置代码生成
配置代码生成设置,例如输出文件名、位置、类型、语言
要控制和配置代码生成过程,需要使用许多参数和设置。这些设置用来控制一些属性,如输出的编译类型(MEX、lib、dll 或 exe),以及输出的语言是 C 还是 C++ 等。其他配置设置使您能够根据特定需求(例如可读性、性能和外部代码集成)自定义生成代码。您可以从 App 或在命令行中修改代码生成配置对象中的配置设置。使用 coder.config 创建配置对象。使用 open 在编辑 App 中打开对象。
函数
coder.config | 创建代码生成配置对象 |
代码配置设置
对象
coder.MexCodeConfig | 从 MATLAB 代码生成 MEX 函数的配置参数 |
coder.CodeConfig | 从 MATLAB 代码生成 C/C++ 代码的配置参数 |
coder.EmbeddedCodeConfig | Configuration parameters for C/C++ code generation from MATLAB code with Embedded Coder |
coder.HardwareImplementation | Hardware-specific configuration parameters for C/C++ code generation from MATLAB code |
coder.hardware | 为从 MATLAB 代码的 C/C++ 代码生成创建硬件板配置对象 |
coder.ReplacementTypes | Configuration parameter to specify custom names for MATLAB built-in data types in C/C++ code generation |
主题
编译配置基础知识
- 配置代码生成和编译设置
在命令行或 MATLAB® Coder™ 中配置代码生成和编译配置参数。 - 路径和文件基础架构设置
指定自定义代码的位置。 - Build Process Support for File and Folder Names
Troubleshoot build process errors that occur when file system issues prevent file processing. - Share Build Configuration Settings
Export project settings to a code generation configuration object or import the settings into a project. - Specify Code Configuration Parameters Interactively
Configure the code generation process by using the Code Generation Settings dialog box.
特定编译选项
- Understand and Control Partitioning of the Generated Code
Understand how file partitioning method and inlining settings interact to control the partitioning of the generated code. - 更改用于代码生成的语言标准
代码生成器使用您在编译设置中指定的语言标准。