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

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

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