Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anyone used the MATLAB tool to produce C/C++ code? Is the resulting code viable for production use?

Tags:

c++

matlab

We have some researchers who do a lot of work in MATLAB. We often would love to try their code as part of a bigger workflow that requies the algorithms to be put into C/C++ or Python. I've seen MathWorks advertise a tool to create native C or C++ code. How good is the code? Does it support the toolboxes? I'd still see it as an early prototyping tool but wondering how good the code is. Thoughts?

like image 956
Rich Sadowsky Avatar asked Aug 12 '11 08:08

Rich Sadowsky


2 Answers

I have worked with mathworks extensively in the past on this. The toolboxes are expensive, but the support is outstanding. We benchmarked code generated for a specific DSP and it was within 10% the speed of hand generated code, and took a fraction of the time to generate. Mathworks has been investing heavily in these toolchains the past several years and they are getting very good. Some toolboxes are supported, look at the docs online.

like image 55
John Avatar answered Sep 24 '22 00:09

John


The code produced by the Embedded Coder is, in my opinion, very good and it's a product that is widely used in industry, especially in automotive applications. It's generally designed to generate code from Simulink for real-time applications though. Look at the user stories on the website: http://www.mathworks.co.uk/products/embedded-coder/?s_cid=global_nav.

Support for toolboxes depends on what your requirements are. If you need something that only uses standard libraries, then support is limited, but if that doesn't matter to you, then you may have more success.

A word of warning though: it's expensive.

like image 24
Nzbuu Avatar answered Sep 24 '22 00:09

Nzbuu