User:Srujanangg

EMBEDDED MATLAB Introduction to the Embedded MATLAB Subset

What Is the Embedded MATLAB Subset?

Embedded MATLAB™ is a subset of the MATLAB® language. The Embedded MATLAB subset supports efficient code generation for prototyping and deploying embedded systems, and accelerating of fixed-point algorithms. It consists of more than 270 MATLAB operators and functions and more than 90 functions from Fixed-Point Toolbox™ software.

See Overview of the Embedded MATLAB Subset in the Embedded MATLAB User's Guide for more information

When to Use the Embedded MATLAB Subset

Use the Embedded MATLAB subset to:

*

Generate readable, efficient, and embeddable C code from M-code *

Generate MEX functions from M-code for rapid prototyping and easy verification of generated C code within MATLAB *

Integrate M-code into Simulink® *

Speed up fixed-point M-code *

Integrate custom C code into MATLAB *

Generate hardware description language (HDL) from M-code

Which Embedded MATLAB Feature to Use To... Use... Required Product	To Explore Further...

Generate MEX functions for rapid prototyping

emlmex function

Simulink or Fixed-Point Toolbox

Try this in Compiling M-Code Using emlmex

emlc command Real-Time Workshop®

Try this in Generating C Code Using emlc

Generate readable and embeddable C code from M-code

emlc command

Real-Time Workshop

Try this in Generating C Code

Integrate M-code into Simulink

Embedded MATLAB function block

Simulink

Try this in Integrating Your Embedded MATLAB Compliant Code with Simulink

Speed up fixed-point M-code

emlmex function

Fixed-Point Toolbox

Learn more in Working with Embedded MATLAB MEX in the Embedded MATLAB User's Guide

Integrate custom C code into MATLAB and generate embeddable code

emlc function

Real-Time Workshop

Learn more in Working with Embedded MATLAB Coder in the Real-Time Workshop User's Guide

Integrate custom C code into an Embedded MATLAB function

eml.ceval function

Real-Time Workshop

Learn more in eml.ceval in the Embedded MATLAB Reference

Generate HDL from M-code

Embedded MATLAB function block

Simulink and Simulink® HDL Coder™

Learn more at www.mathworks.com/ products/slhdlcoder

When Not to Use the Embedded MATLAB Subset

The Embedded MATLAB subset is not designed for the following applications. Use the recommended MathWorks™ product instead. To... Use... Deploy an application that uses handle graphics	MATLAB Compiler™ Use Java™	MATLAB® Builder JA Use toolbox functions that the Embedded MATLAB subset does not support	Toolbox functions that you rewrite for embedded applications Deploy M-based GUI applications on a supported MATLAB host	MATLAB Compiler™ Deploy web-based or Windows® applications	MATLAB® Builder NE Interface C code with MATLAB

MATLAB mex function

Benefits of Using the Embedded MATLAB Subset

Working with the Embedded MATLAB subset allows you to perform your embedded software design, implementation, and testing completely within the MATLAB workspace. In addition, it enables you to generate efficient, readable, and embeddable C code automatically from your M-code.

Within the MATLAB development environment, you can:

*

Ensure your M-code is compliant with the Embedded MATLAB subset. *

Generate C code automatically from your M-code, which eliminates the need to manually translate your MATLAB algorithms and minimizes the risk of introducing errors in the code. *

Modify your design in M-code to take into account the specific requirements of embedded applications, such as data type management, memory use, and speed. *

Test the generated code and easily verify that your modified algorithms are functionally equivalent to your original MATLAB algorithms.