How to build .m file into .mex file

조회 수: 6 (최근 30일)
dukek
dukek 2015년 10월 24일
답변: Rahul Goel 2015년 10월 28일
I know that Matlab Coder is recommended for the task in question. But I don't have access to that toolbox. I can compile the .m file into a C library that probably can be linked to build a mex file. I am wondering if there is any instruction or hints on how to do this? Basically to do things manually as what the Matlab Coder does. Thanks in advance to anyone who can shed some lights on this.
The purpose is to protect the m code. The security of pcode is apparently not good enough. Try google matlab depcode ...

답변 (1개)

Rahul Goel
Rahul Goel 2015년 10월 28일
You can refer to the following documentation for linking "C" libraries during creation of "mex" files: http://www.mathworks.com/help/matlab/ref/mex.html#inputs
Also, creating a mex file from a C code and generating C code using MATLAB coder are two very different things. I doubt if the functionality of MATLAB Coder can be replicated by building mex files from C libraries. Mex files are built by creating a wrapper over your source code and allowing it to be used as executable on MATLAB platform. On the other hand MATLAB Coder generates the appropriated C code by evaluating each line of the source MATLAB code.
Hope this helps.

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by