Generate C/C++ Code - MATLAB & Simulink (original) (raw)

Main Content

After you prepare your MATLAB® code for code generation, specify input types, and check your code for issues, you can generate standalone C/C++ code or an accelerated MEX function. See theCode Generation Workflow.

Generate Standalone C/C++ Code

To generate standalone C/C++ code:

After you generate standalone C/C++ code, you can:

For details, see Deploy Generated Code and Package Code for Other Development Environments.

Generate an Accelerated MEX Function

To generate an accelerated MEX function:

Before you generate an accelerated MEX function:

After you generate an accelerated MEX, you can call the MEX function in MATLAB. See Call MEX Functions. You can also explore further opportunities for acceleration by using the MATLAB Profiler to identify portions of the generated MEX function that are highly time-intensive. See Profile MEX Functions by Using MATLAB Profiler.

Accelerated MEX functions can be used to speed applications and simulations in a number of different toolboxes. For example:

See Also

codegen

Topics

External Websites