C++ Code Generation - MATLAB & Simulink (original) (raw)

Main Content

MATLAB® Coder™ enables you to either generate C or C++ code. The code generator produces C code by default. Generated C++ code can use functionality not available in the C language that can make the C++ code more readable and easier to use.

Generate C++ Code

To generate C++ code, follow the code generation workflow. See Overview of Code Generation Using MATLAB Coder.

To instruct the code generator to produce C++ code, use one of these approaches:

C++ Language Features Supported in Generated Code

To learn about code generation that utilizes key C++ language features, refer to these help topics:

These examples illustrate the use of these functionalities:

Additional Differences Between Generated C Code and C++ Code

If you separately generate C and C++ code for the same MATLAB function, and inspect the generated source code, then there are implementation differences. These are some notable differences:

See Also

codegen

Topics