Transfer M-file into C code
显示 更早的评论
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.
回答(1 个)
Walter Roberson
2011-6-1
0 个投票
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 个评论
Fangjun Jiang
2011-6-1
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
2011-6-1
You people change the names on me at least once per decade -- how do you expect me to keep up?! ;-)
Arnaud Miege
2011-6-2
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.
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!