Evaluation of Compilers for MATLAB- to C-Code Translation

Markus Muellegger · KTH Publication Database DiVA (KTH Royal Institute of Technology) · 2008

MATLAB to C code translation is of increasing interest for science and industry. In detail two MATLAB to C compilers denoted as Matlab to C Synthesis (MCS) and Embedded MATLAB C (EMLC) have been studied. Three aspects of automatic code generation have been studied; 1) generation of reference code; 2) target code generation; 3) floating-to-fixed-point conversion. The benchmark code used aimed to cover simple up to more complex code by being viewed from a theoretical as well as practical perspective. A fixed-point filter implementation is demonstrated. EMLC and MCS offer several fixed-point design tools. MCS provides a better support for C algorithm reference generation, by covering a larger set of the MATLAB language as such. More suitable for direct target implementation is code generated from EMLC. As a result of the need to guarantee that the EMLC generated C-code allocates memory only statically, MATLAB becomes more constraint by EMLC. Functional correctness was generally achieved for each automatic translation.

Read the paper · More papers on PaperTik