Main Content

生成代码

生成代码并构建独立库和可执行文件

C/C ++代码生成是MATLAB®CODER™。Generate code from the app, which you can open withcoder, or from the command line, by using the代码根function. The app provides step-by-step guidance through the code generation process, including guidance for best practices, and clear visual aids for the code generation settings and options. The command line workflow enables simple, repeatable, and efficient initiation of code generation. The code generation workflow supports many different data types, including variable-size data and global data. The workflow also supports multiple entry-point (top-level) functions, multisignature MEX function generation, and customization of fundamental properties such as the array layout and array indexing of the generated code. In addition, you can generate code that uses key C++ language features such as classes, namespaces, and function overloading.

应用

展开全部

MATLAB编码器 从中生成C代码或MEX函数MATLABcode

职能

展开全部

coder 打开MATLABCoder应用程序
代码根 Generate C/C++ code fromMATLABcode
coder.target Determine if code generation target is specified target
Coder.AllowPcode 受保护的控制代码生成MATLABfiles
coder.config CreateMATLABCoder代码生成配置对象
coder.extrinsic 将功能声明为外部功能并在MATLAB
coder.load 从垫子文件或ASCII文件加载编译时间常数到呼叫者工作区
coder.nullcopy 在代码生成中声明非初始化变量
coder.newtype Createcoder.Type目的to represent type of an entry-point function input
编码器 声明可变大小数据
coder.typeof Createcoder.Type对象表示入口点功能输入的类型
编码器 Resizecoder.Type目的
coder.ceval Call external C/C++ function
编码器 将标题文件包括在生成的代码中
coder.cstructname 名称C结构类型以生成代码类型
coder.opaque 在生成代码中声明变量
编码器 Indicate data to pass by reference
coder.rref Indicate read-only data to pass by reference
编码器 指示仅写入数据以通过参考

对象

展开全部

coder.MexCodeConfig Configuration parameters for MEX function generation fromMATLABcode
coder.CodeConfig C/C ++代码生成的配置参数MATLABcode
Coder.embeddedCodeConfig C/C ++代码生成的配置参数MATLAB代码Embedded Coder
coder.OutputType 输出类型从入口点函数指定为输入类型

话题

生成代码基础

Switch Between Command Line and Project Workflows

特定于数据的工作流程

Extended Functionality

扩展的C ++功能

代码外观

  • 保留的关键字
    Certain words in your code, that are C/C++ keywords, might be renamed in the generated code.