Main Content

Code Generation Guide: Generate Deployable C/C++ Code

MATLAB® Coder™ enables you to generate C/C++ code for your MATLAB code. You can:

  • Generate standalone C/C++ code to use in your projects as source code, static libraries, or dynamic libraries.

  • Generate MEX code to accelerate computation-intensive operations.

Follow the tasks in this guide to learn about standalone code generation and its deployment.

  1. Prepare your MATLAB code for code generation.

  2. Generate C/C++ code from your MATLAB code.

  3. Test the generated C/C++ code.

  4. Deploy the generated code to your existing projects.

To identify the tasks required to complete your code generation process, use this workflow diagram.

Quick Start Workflow

This image highlights the steps involved in the code generation. It starts with identifying the function to generate code for. In the second step, prepare the MATLAB code for code generation. In the third step, specify input types and check for run-time issues. Follow this by configuring build settings and generating code. Test the generated code to see if it performs as expected. If not, make changes in the code or in the build configurations. Deploy the required code as the last step.

To start the tutorial, see Prepare MATLAB Code for Code Generation.

Related Topics