模型配置集自定义
自定义代码生成器生成代码的方式
模型配置集包含控制代码生成器如何从模型生成代码的参数。要控制生成代码的代码优化、接口、代码样式、编译选项和其他方面,请使用配置参数。当您要对许多模型使用相同的设置时,可以在这些模型之间共享同一个配置集。您还可以使用脚本以编程方式配置模型的代码生成。
模型设置
主题
代码生成配置集
- Code Generation Configuration
Modify the model configuration parameters specific to code generation from the Configuration Parameters Dialog box. - Use Configuration Reference to Select Code Generation Target
Select a code generation target for a model reference hierarchy without modifying individual models. - 以编程方式配置模型的代码生成参数
从 MATLAB® 命令行修改特定于代码生成的模型配置参数。 - Recommended Settings Summary for Model Configuration Parameters
Summary of code generation parameters for tuning model and target configurations.
模型配置参数:代码生成
- 模型配置参数:代码生成
用于为模型的活动配置集定义代码生成的一般参数,包括目标选择、文档和编译过程。 - 模型配置参数:代码生成优化
用于配置代码优化的参数。 - Model Configuration Parameters: Code Generation Report
Parameters for configuring code generation reports. - Model Configuration Parameters: Comments
Parameters for controlling the comments that you want to automatically generate and insert into the generated code. - 模型配置参数:代码生成标识符
用于在代码生成中为标识符选择自动生成的命名规则的参数。 - 模型配置参数:代码生成自定义代码
用于创建要包含在生成文件中的自定义 C 代码、文件夹、源文件和库列表的参数。 - 模型配置参数:代码生成接口
用于选择目标软件环境、输出变量名称修饰符和数据交换接口的参数。
代码注释
- Configure Code Comments
Configure how code generator inserts comments into generated code. - Include MATLAB Code as Comments in Generated Code
Correlate code generated for a MATLAB Function block with MATLAB source code.
标识符
- Reserved Keywords
If you use the code generator to produce C or C++ code, your model must not contain keywords that are reserved for internal use. - Specify Identifier Length to Avoid Naming Collisions