Signal Processing DesignLine Blog

MATLAB to C showdown

Kenton Williston

12/10/2007 10:02 PM EST

The time-consuming and headache generating process of manually converting MATLAB to C has kept many an algorithm on the shelf, but recent automation tools from The MathWorks and startup Catalytic are giving algorithm designers hope.

On the surface Catalytic's MCS and The MathWork's Embedded MATLAB are very similar. Both automatically generate ANSI-C code from MATLAB. Both support basic MATLAB language constructs such as multidimensional arrays, structures, and flow control. And both support roughly 300 MATLAB functions.

From there, important differences emerge. For one, Embedded MATLAB targets a wide range of embedded apps, from communications, to aerospace/defense, to automotive, etc. Catalytic focuses more on DSP. For example, Catalytic gives you a larger number of FFTs and 2D DSP functions than Embedded MATLAB. Embedded MATLAB provides more support for general purpose processing.

Which tool is best for a given application will depend not only on which functions/language constructs are supported, but on what MATLAB code you start with and what happens to the generated C code. For example, suppose you want to port existing MATLAB algorithms to C so you can integrate them into a C system model. In this case, MCS is probably the better choice. Now suppose you want to generate C code for an embedded target, and you don't have an existing MATLAB code base. In this case, Embedded MATLAB is likely the right pick.

If you want to integrate MATLAB code into an existing desktop application, you may not want to convert at all. The MathWorks has made it possible to embed the MATLAB processing engine into desktop apps. This allows desktop applications to simply run MATLAB code unmodified on top of a "virtual MATLAB," thereby speeding application development considerably.

Other important considerations include differences in the translation process and differences in the MATLAB coding styles required for optimum performance. For a good insight into Catalytic's approach, check out their informative three part How-To series MATLAB-to-C translation. For more on Embedded MATLAB stay tuned for a series of How-To articles from The MathWorks.





Please sign in to post comment

Navigate to related information

Datasheets.com Parts Search

185 million searchable parts
(please enter a part number or hit search to begin)
Jobs sponsored by

Feedback Form