Transfer M-file into C code
Mostrar comentarios más antiguos
Hi, I want to transfer some function (M file) to C code to enhance my speed. I wonder how to do this and how to call the transferred function. Thank you very much.
Respuestas (1)
Walter Roberson
el 1 de Jun. de 2011
0 votos
If you want to rewrite the code by hand, you can use mex files. You can do this even with just the basic MATLAB.
If you want to generate the code, then you need MATLAB Coder (current name; MATLAB Compiler in previous versions.) That is an extra-cost product.
3 comentarios
Fangjun Jiang
el 1 de Jun. de 2011
Walter,MATLAB Coder is the right tool to transfer M-file into C code. However, it is not the new name for MATLAB Compiler. You probably meant RTW (Real Time Workshop). Now it is re-named Simulink Coder. MATLAB Compiler is to compile M-file into executable.
Walter Roberson
el 1 de Jun. de 2011
You people change the names on me at least once per decade -- how do you expect me to keep up?! ;-)
Arnaud Miege
el 2 de Jun. de 2011
Fangjun's right. Just to clarify:
Pre-R2011a, you could generate C code from MATLAB using Embedded MATLAB. This required you to have Real-Time Workshop, which required Simulink, even if you were not using it.
In R2011a, MATLAB was introduced (a new product) and Real-Time Workshop was merged with Stateflow Coder and renamed to Simulink Coder. This means that for generating C code from MATLAB, you now only need MATLAB Coder and nothing else. MATLAB Coder is a pre-requisite for Simulink Coder.
Categorías
Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!