Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

MATLAB Coder

MATLAB 代码生成 C 和 C++ 代码

MATLAB® Coder™ 可从 MATLAB 代码生成适用于各种硬件平台(从桌面计算机系统到嵌入式硬件)的 C 和 C++ 代码。它支持大多数 MATLAB 语言和广泛的工具箱。您可以将生成的代码作为源代码、静态库或动态库集成到您的工程中。生成的代码是可读且可移植的。您可以将它与现有 C 和 C++ 代码及库的关键部分结合使用。您还可以将生成的代码打包为 MEX 函数以在 MATLAB 中使用。

与 Embedded Coder® 结合使用时,MATLAB Coder 可提供代码自定义、特定于目标的优化、代码可追溯性以及软件在环 (SIL) 和处理器在环 (PIL) 验证。

要将 MATLAB 程序部署为独立应用程序,请使用 MATLAB Compiler™。要生成与其他编程语言集成的软件组件,请使用 MATLAB Compiler SDK™

MATLAB Coder 快速入门

MATLAB Coder 基础知识学习

用于代码生成的 MATLAB 编程

用于代码生成的 MATLAB 语言语法和函数;数据定义

代码生成

C/C++ 和 MEX 代码生成、修复错误、行为验证

部署

使用并运行生成的 C/C++ 代码

性能

缩短代码生成时间,提高执行速度,减少所生成代码的内存使用量

MATLAB 算法加速

使用生成的 MEX 函数加速代码执行

数值转换

定点转换、单精度转换(需要 Fixed-Point Designer™)

使用 MATLAB Coder 进行深度学习

生成用于深度学习神经网络的 C/C++ 代码(需要 Deep Learning Toolbox™)

MATLAB Coder 支持的硬件

对第三方硬件的支持


查看 Bug 报告以确定并解决问题

Software is inherently complex and is not free of errors. The output of a code generator might contain bugs, some of which are not detected by a compiler. MathWorks reports critical known bugs brought to its attention on its Bug Report system at www.mathworks.com/support/bugreports/. In the search bar, type the phrase "Incorrect Code Generation" to obtain a report of known bugs that produce code that might compile and execute, but still produce wrong answers. To save a search, click Save Search.

The bug reports are an integral part of the documentation for each release. Examine periodically all bug reports for a release, as such reports may identify inconsistencies between the actual behavior of a release you are using and the behavior described in this documentation.

In addition to reviewing bug reports, you should implement a verification and validation strategy to identify potential bugs in your design, code, and tools.

搜索 R2024a Bug 报告

导致生成错误代码的已知 Bug
本产品的所有已知 Bug