C code generation from Matlab (m-file)

Jun 17, 2008 4 Replies

Can i generate c code from matlab m-files I believe that c code can be generated from simulink models using rea time workshop but can the same be done using m-files instead of simulink.


Look at MCS from AgilityDS

formatting link

Hans

formatting link

Yes, if you have the matlab Compiler product. Otherwise you have to code by hand.

There are third party converter products, but they aren't cheap.

formatting link

Yes, I do it all the time, you have to first drag an embedded matlab block into simulink, then put your m code inside it, there are some limitations as far as what functions you can and cannot use in the m file, but not too bad, then hit the generate code button, out comes commented C code (well it just take the comments from your m file).

The Embedded MATLAB Coder product from MathWorks allows you to generate C from matlab m files without using simulink

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required