Code generation from MATLAB® is a restricted subset of the MATLAB language that provides optimizations for:
Generating efficient, production-quality C/C++ code and MEX files for deployment in desktop and embedded applications. For embedded targets, the subset restricts MATLAB semantics to meet the memory and data type requirements of the target environments.
Depending on which feature you wish to use, there are additional required products. For a comprehensive list, see Installing Prerequisite Products (MATLAB Coder).
Code generation from MATLAB supports Signal Processing Toolbox™ functions
listed in the table. To generate C code, you must have the MATLAB Coder™ software.
If you have the Fixed-Point Designer™ software, you can use
fiaccel to generate MEX code for
To follow the examples in this documentation:
To generate C/C++ code and MEX files with
codegen, install the MATLAB Coder software,
the Signal Processing Toolbox, and a C compiler. For the Windows® platform, MATLAB supplies
a default C compiler. Run
mex -setup at the MATLAB command
prompt to set up the C compiler.
Change to a folder where you have write permission.
An asterisk (*) indicates that the reference page has usage notes and limitations for C/C++ code generation.