Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

C Code Generation

Generate C and C++ code from MATLAB® and Simulink®

Generate C and C++ code from signal processing algorithms in DSP System Toolbox™ using the MATLAB Coder™ and Simulink Coder products. You can integrate the generated code into your projects as source code, static libraries, dynamic libraries, or even standalone executables. For more information, see Understanding C Code Generation in DSP System Toolbox. In addition, you can also generate code optimized for ARM® Cortex®-M and ARM Cortex-A processors using the Embedded Coder® product. For more information, see ARM Cortex-M and ARM Cortex-A Optimization. Once you generate code, you can relocate the code to another development environment that does not have MATLAB and Simulink products installed. For examples, see Relocate Code Generated from MATLAB Code to Another Development Environment and Relocate Code Generated from a Simulink Model to Another Development Environment.

Functions

codegenGenerate C/C++ code from MATLAB code

Topics

Understanding C Code Generation in DSP System Toolbox

Generate C code from DSP System Toolbox signal processing algorithms using MATLAB Coder and Simulink Coder.

Functions and System Objects Supported for C Code Generation

Signal processing functions and System objects that support code generation

MATLAB Language Features Supported for C/C++ Code Generation (MATLAB Coder)

Use the MATLAB language features and functions that code generation supports.

System Objects in MATLAB Code Generation (MATLAB Coder)

Special considerations for using System objects in code generated from MATLAB

Generate C Code from MATLAB Code

Prepare MATLAB code for code generation and generate C-MEX code and a C executable.

Relocate Code Generated from MATLAB Code to Another Development Environment

Generate an executable from MATLAB algorithm. Package the executable to run on an external environment.

Generate C Code from Simulink Model

Build an executable and run the executable within MATLAB.

Relocate Code Generated from a Simulink Model to Another Development Environment

Generate an executable from Simulink model and package the executable to run on an external environment.

Array Plot with Apple iOS Devices

Array Plot with Android Devices

ARM Cortex-M and ARM Cortex-A Optimization

Generate C code optimized for ARM Cortex-M and ARM Cortex-A processors.

How To Run a Generated Executable Outside MATLAB

Commands to set the system environment for generating executables that require prebuilt dll files.

Use Generated Code to Accelerate an Application Deployed with MATLAB Compiler

Use MATLAB Coder to accelerate an algorithm and MATLAB Compiler™ to deploy the application.

Featured Examples

Was this topic helpful?