2

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?

2 Answers 2

1

I don't know what you are trying to say but I'll explain how mex helped me.

  1. 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.
  2. 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
  3. This generates a foo.mexw32 or foo.mexw64 in Windows and you can call it like a Matlab Function.
  4. 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.

1
  • There is a way to generate MEX files from IDE and not MATLAB itself.
    – Royi
    Feb 24, 2017 at 9: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!

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.