1

Matlab has well optimized functions which I also want to use in other projects. The mex files are actually DLL files, and provided proper interface, they should be able to called by other programs. Is it possible to use the mex functions outside?

PS: calling matlab engine is definitely a way to use matlab outside. But this requires installation of matlab. Matcom is another way, but i wonder if there is a way to call mex as DLLs directly.

Fontaine007
  • 577
  • 2
  • 8
  • 18

1 Answers1

0

What MEX functionality would you want to use? I assume you know that mexCallMATLAB doesn't work without MATLAB (I'm pretty sure MCR is not sufficient), so you are not left with much. The MEX file itself doesn't have the MATLAB engine. You can call a number of BLAS and LAPACK functions, but there are other free solutions for these libraries. You can create and manipulate mxArrays, but not do much with them. Maybe you can use some Intel MKL functions, with some effort. Probably what you want is Compiler, Engine or Coder, depending on your use case.

Community
  • 1
  • 1
chappjc
  • 30,359
  • 6
  • 75
  • 132
  • In fact, I would like to use conv2 function outside; but surprisingly there lacks such a library of this very common function (either too specific or badly designed). The only hope seems to be the Octave. – Fontaine007 Aug 12 '14 at 16:24
  • 1
    @JasonYuan Try http://fftwpp.sourceforge.net/ (free) or Intel IPP (not free in general, but there is a [stripped down version called ICV](http://sourceforge.net/projects/opencvlibrary/files/3rdparty/ippicv/) that is granted to OpenCV for free use in it's project). – chappjc Aug 13 '14 at 21:20