MATLAB 算法加速
使用生成的 MEX 函数加速代码执行
通过生成 MEX 函数加快 MATLAB® 代码的计算量密集部分的执行速度。为获得最佳结果,请遵循最佳做法并使用优化策略。
函数
codegen | 从 MATLAB 代码生成 C/C++ 代码。 |
主题
- 加速 MATLAB 算法的工作流
遵循加速 MATLAB 算法的工作流。
- Accelerate MATLAB Algorithms
Accelerate MATLAB algorithms by generating MEX functions.
- 使用 MATLAB Coder App 生成 MEX 函数
按照使用 MATLAB Coder™ App 生成 MEX 函数的工作流进行操作。
- Generate MEX Functions at the Command Line
Follow the workflow for generating MEX functions with
codegen
. - Code Generation for Incremental Learning (Statistics and Machine Learning Toolbox)
Generate code that implements incremental learning for binary linear classification at the command line.
- Best Practices for Using MEX Functions to Accelerate MATLAB Algorithms
Follow best practices for using MEX functions to accelerate MATLAB algorithms.
- 使用 MATLAB 探查器探查 MEX 函数
请在 MATLAB 探查器中查看生成的 MEX 函数的执行时间和代码覆盖率。
- Control Run-Time Checks
Improve performance by disabling run-time checks.
- 优化策略
优化所生成的代码的执行速度或内存使用量。
- Use Generated Code to Accelerate an Application Deployed with MATLAB Compiler
Use MATLAB Coder to accelerate an algorithm used by an application that you intend to deploy with MATLAB Compiler™.