Main Content

本页的翻译已过时。点击此处可查看最新英文版本。

模型配置

配置模型以进行仿真和代码生成

涉及代码生成的模型配置参数定义代码生成器如何从模型中生成代码并编译可执行文件。模型顾问可以检查您的模型是否符合各项标准和规范,以及是否准备好生成代码。Code Generation Advisor 会根据您指定的目标来审核您的模型。要在预定义的效率、可追溯性、安全预防和调试目标之外进一步扩展功能,请创建自定义目标。

模块

全部展开

Custom MATLAB fileUpdate active configuration parameters of parent model by using file containing custom MATLAB code
ERT (optimized for fixed-point)Update active configuration parameters of parent model for ERT fixed-point code generation
ERT (optimized for floating-point)Update active configuration parameters of parent model for ERT floating-point code generation
GRT (debug for fixed/floating-point)Update active configuration parameters of parent model for GRT fixed-point or floating-point code generation
GRT (optimized for fixed/floating-point)Update active configuration parameters of parent model for GRT fixed-point or floating-point code generation

对象

全部展开

rtw.codegenObjectives.ObjectiveCustom code generation objective

主题

快速入门

Code Generation Configuration

Modify the model configuration parameters specific to code generation from the Configuration Parameters Dialog box.

代码生成配置

Configure Code Generation Parameters for Model Programmatically

Modify the model configuration parameters specific to code generation from the MATLAB® command line.

Generate Code by Using the Quick Start Tool

Prepare a model for quickly generating readable, efficient code.

Configuration Variations

Retarget code generation from a model with multiple configuration sets.

Use Configuration Reference to Select Code Generation Target

Select a code generation target for a model reference hierarchy without modifying individual models.

Configure and Optimize Model with Configuration Wizard Blocks

Easily configure and optimize code generation options with Configuration Wizard blocks and scripts.

模型顾问

使用模型顾问检查您的模型

使用模型顾问检查您选择的模型或子系统的条件和配置设置,包括导致不准确或低效仿真的条件。

Check Model and Configuration for Code Generation

Assess model readiness to generate code by using the Model Advisor and Code Generation Advisor.

Embedded Coder Model Advisor Checks for Standards, Guidelines, and Code Efficiency

Use Embedded Coder® Model Advisor checks to assess model readiness to generate code.

Simulink Coder Model Advisor Checks for Standards and Code Efficiency

Use Simulink® Coder™ Model Advisor checks to assess model readiness to generate code.

Modeling Guidelines for Model Configuration

When you develop models and generate code, use the modeling guideline configuration recommendations.

Code Generation Advisor

Configure Model for Code Generation Objectives by Using Code Generation Advisor

Use the Code Generation Advisor to check your model against code generation objectives.

Configure Code Generation Objectives Programmatically

Configure your code generation objectives from the MATLAB command line.

Create Custom Code Generation Objectives

Create predefined code generation objectives to meet your requirements.

Recommended Settings Summary for Model Configuration Parameters

Summary of code generation parameters for tuning model and target configurations.

Code Generation Advisor Checks

Facilitate designing Simulink models and subsystems and troubleshooting code generation by using Code Generation Advisor checks.

模型配置参数:代码生成

Model Configuration Parameters: Code Generation

General parameters for defining code generation for a model's active configuration set, including target selection, documentation, and build process.

Model Configuration Parameters: Code Generation Optimization

Parameters for configuring code optimization.

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.

Model Configuration Parameters: Code Generation Identifiers

Parameters for selecting automatically generated naming rules for identifiers in code generation.

Model Configuration Parameters: Code Generation Custom Code

Parameters for creating a list of custom C code, folders, source files, and libraries to include in generated files.

Model Configuration Parameters: Code Generation Interface

Parameters for selecting the target software environment, output variable name modifier, and data exchange interface.

Model Configuration Parameters: Code Style

Parameters for controlling the automatically generated code style for readability.

Model Configuration Parameters: Code Generation Verification

Code verification and performance analysis parameters for SIL and PIL simulations.

Model Configuration Parameters: Code Generation Templates

Parameters for customizing generated code organization.

Model Configuration Parameters: Code Generation Code Placement

Parameters for specifying data placement in the generated code.

Model Configuration Parameters: Code Generation Data Type Replacement

Parameters for replacing built-in data type names with user-defined replacement data type names in the generated code.

Model Configuration Parameters: Code Generation AUTOSAR

Parameters for controlling AUTOSAR code generation.

特色示例