| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Embedded MATLAB |
| Contents | Index |
To convert MATLAB code into efficient, embeddable C code, you must consider the following:
Data types
C uses static typing. Therefore, you must declare the data type of all variables at compile time.
Array sizing
The Embedded MATLAB subset supports variable-size arrays and matrices with known upper bounds. With this feature, you can define inputs, outputs, and local variables in Embedded MATLAB functions to represent data that varies in size at runtime.
For more information, see Generating Code for Variable-Size Data in the Embedded MATLAB User's Guide.
Memory use
Because dynamic memory allocation is not suitable for mission or safety-critical applications, the Embedded MATLAB subset supports only static memory allocation in the generated code.
Speed
Because embedded applications need to run in real time, the code must be fast enough to meet the required clock rate.
Memory
Embedded processors have a limited amount of available memory. As a result, data storage must be minimized, and the code must be as compact as possible.
To learn how to apply these design considerations, you work with Example: The LMS Filter.
![]() | Tasks For Generating C Code | Example: The LMS Filter | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |