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
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
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
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
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에 대해 자세히 알아보기

질문:

Di
2011년 6월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by