Skip to Main Content Skip to Search
Product Documentation

Preparing MATLAB Code for C/C++ and MEX Code Generation

By default, the MATLAB language uses dynamic typing. Properties of dynamically typed variables can change at runtime, allowing a single variable to hold a value of any class, size, or complexity. However, to generate efficient code for statically typed languages such as C and C++, the properties of all MATLAB variables must be determined at compile time. Therefore, to prepare MATLAB code for C, C++, and MEX code generation, you must specify the class, size, and complexity of inputs to the primary function (also known as the top-level or entry-point function). By determining these properties at compile time, the code generation process translates your MATLAB algorithms into code that is efficient and tailored to your specific application, rather than producing generic code that handles every possible set of MATLAB inputs.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS