I want to code and build Matlab mex files on Eclipse IDE. How could I do to include mex compiler as one of the c++/c compilers and build the mex code I have with that compiler on Eclipse?
Asked
Active
Viewed 1,700 times
2 Answers
1
I don't know what you are trying to say but I'll explain how mex helped me.
- Mex is - Matlab Executable this you'd be using to create the functions similar to Matlab functions Ex: function varargout = foo(varargin). This foo will be your foo.c or foo.cpp.
- The foo.c or cpp is compiled with the well known C/C++ Compilers mentioned here -http://www.mathworks.in/support/compilers/R2012a/win64.html
- This generates a foo.mexw32 or foo.mexw64 in Windows and you can call it like a Matlab Function.
- What you can do is write a code in Eclipse using the C compiler it has get it execute and port it to mex functions easily. Select the compilers from mex -setup
I found this tutorial extremely helpful : Mex Tutorial
and I doubt there is something call "Mex compiler" atleast I've not come across.

Sridutt
- 382
- 3
- 14
-
There is a way to generate MEX files from IDE and not MATLAB itself. – Royi Feb 24 '17 at 09:52
1
I use the tutorial of http://ngoonee.xanga.com/664222870/compiling-mexw32-mex-for-windows-files-using-eclipse-cdt-ide-mingw-gcc-compiler/
Works for me!

erogol
- 13,156
- 33
- 101
- 155
-
The link is dead. Probably it will be similar for what should be done in Visual Studio - https://www.mathworks.com/help/matlab/matlab_external/compiling-mex-files-with-the-microsoft-visual-c-ide.html. See http://stackoverflow.com/questions/6611538/how-to-compile-a-mex-file. – Royi Feb 24 '17 at 10:54