How to build .m file into .mex file

6 visualizaciones (últimos 30 días)
dukek
dukek el 24 de Oct. de 2015
Respondida: Rahul Goel el 28 de Oct. de 2015
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 ...

Respuestas (1)

Rahul Goel
Rahul Goel el 28 de Oct. de 2015
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.

Categorías

Más información sobre MATLAB Compiler en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by