Reputation: 165
is there s a way to convert simulink blocks or a matlab ".m" code to C code automatically ?
Upvotes: 3
Views: 6040
Reputation: 19880
To convert Simulink models or MATLAB m-code to C you need Real-Time Workshop. It supports only subset of MATLAB language and oriented for embedded systems.
Look also at other MatWorks products for code generation and application deployment: http://www.mathworks.com/products
With MATLAB Compiler you will not get a C code, but a binary code, executable or library (dll), which will run on machines without MATLAB installed, but with MATLAB Compiler Runtime (MCR) library. It quite large in size, and platform specific and I believe it has to match the MATLAB version of compiled code.
For the new coming release 2011a The MathWorks developed new code generation products: MATLAB Coder, Simulink Coder and Embedded Coder.
Upvotes: 2
Reputation: 10395
I'm not aware of any direct translation tool, but there are a few alternatives:
Upvotes: 3