MathWorks’ Embedded MATLAB streamlines C code generation

Oct. 11, 2007
The MathWorks (www.mathworks.com) has developed Embedded MATLAB, a subset of its MATLAB high-level programming language that allows users to generate embeddable C code from MATLAB files without having to go through Simulink, The Mathworks’ graphical environment.

The MathWorks has developed Embedded MATLAB, a subset of its MATLAB high-level programming language that allows users to generate embeddable C code from MATLAB files without having to go through Simulink, The Mathworks’ graphical environment.

Jim Tung, a MathWorks Fellow, says Embedded MATLAB will appeal to MATLAB users who are designing algorithms and want to generate embeddable C code quickly, without Simulink. It will also facilitate the sharing of algorithms for system design.

MATLAB is commonly used for expressing idealized algorithms that require extensive simulation before they can be implemented, while Simulink has been used for automatic generation of C and C++ code for a decade, and more recently for generation of VHDL and Verilog code, but Tung noted that users focused on algorithm development may not have access to Simulink or may not be trained to use it. They also may not have or may not need an understanding of the system of which their algorithm is a part.

Another use case, according to Tung, involves workflow across groups in which some engineers create reusable components while others are design systems that use those components. “It was often the case that algorithms expressed in MATLAB were manually translated to C and converted to fixed point code,” he said.

“The manual process wastes time and resources, and results in two design ‘truths,’ the original expression in MATLAB and the C code translation. This creates a configuration management problem, but with Embedded MATLAB, the algorithm as created in MATLAB does not have to be changed. Algorithms created in MATLAB can be passed directly to Real Time Workshop, which automatically generates C code.”

Tung said Embedded MATLAB also facilitates workflow between algorithm developers and system developers. “In the past, Simulink users could hardwire MATLAB code into a Simulink function block and generate C code from there. The code then became part of the Simulink model. Now, it’s easier for Simulink users to incorporate multiple algorithms into their model. It’s also possible for Simulink users to generate HDL code for MATLAB blocks,” he said.

Embedded MATLAB is included in the latest MATLAB release (2007B) at no additional cost.

Sponsored Recommendations

The Importance of PCB Design in Consumer Products

April 25, 2024
Explore the importance of PCB design and how Fusion 360 can help your team react to evolving consumer demands.

PCB Design Mastery for Assembly & Fabrication

April 25, 2024
This guide explores PCB circuit board design, focusing on both Design For Assembly (DFA) and Design For Fabrication (DFab) perspectives.

What is Design Rule Checking in PCBs?

April 25, 2024
Explore the importance of Design Rule Checking (DRC) in manufacturing and how Autodesk Fusion 360 enhances the process.

Unlocking the Power of IoT Integration for Elevated PCB Designs

April 25, 2024
What does it take to add IoT into your product? What advantages does IoT have in PCB related projects? Read to find answers to your IoT design questions.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!