Questions tagged [mex]

MEX-files (MEX stands for Matlab EXecutable) are dynamically linked subroutines produced from C, C++ or Fortran source code that, when compiled, can be run from within MATLAB® in the same way as MATLAB functions or built-in functions.

In general, MATLAB can be quite efficient in performing a wide variety of numerical tasks. However, from time to time there are certain tasks that require more "low-level" control over the execution. For these kind of tasks MATLAB allows for an easy interface to C/C++/Fortran subroutine pre-compiled and ready to be used as any built-in function.

Here are some useful links for MEX-files:

1435 questions
-1
votes
1 answer

Invalid MEX-file error CascadeClassifier_.mexmaci64, libopencv_ocl.2.4.dylib

I am on OSX 10.10. I am trying to run a demo of a project which uses the following libraries and programs: MATLAB R2014b 64-bit. OpenCV 2.4.10.1 installed through Homebrew. VLFeat 0.9.20. mexopencv. I have run mex -setup in MATLAB…
-1
votes
3 answers

finding local mean in an image using mex-cuda

I have an image named HSIImage, of size is 565x585, in which I have find the local mean and standard deviation at every pixel. For this I am using a window W of size 9x9, if we a re finding the mean of x(i,j) we need values in the W where x(i,j) is…
Pawan
  • 363
  • 4
  • 26
-1
votes
1 answer

setting sampling time in c mex s func

What is the equivalent of the following for a C-mex s function? That is, how do I set discrete sample time of a block to the top level fixed step size in C? My problem is, I could not find a way to "get" the top level fixed step size parameter in…
-1
votes
1 answer

MATLAB linking wrong OpenCV folder (OS X)

I'm running some MATLAB code (OpenTLD) that calls OpenCV, however it appears I have duplicates of some of the dylibs which is confusing…
chris
  • 4,197
  • 3
  • 31
  • 60
-1
votes
1 answer

Old gcc compiler on matlab

I am using MATLAB on the Linux MINT. I have a C program for which I want to used mex command as follows: mex /home/.../binary.c -output binary_m but I get the following error Warning: You are using gcc version "4.8.1-10ubuntu9)". The version …
user42037
  • 37
  • 7
-1
votes
1 answer

Setting environment variable when using Mex environment

I am currently using a package called Cuba, and I would like to use it within a Matlab mex environment. The problem is, how can I set the environment variable CUBACORES to disable the automatic parallelization? This does not work with mex: export…
lorniper
  • 586
  • 1
  • 5
  • 26
-1
votes
2 answers

How can I compile ANSI C99-based MEX code delivered with Linux makefiles under Win64 MATLAB?

It seems I've got a real problem here due to my lack of any knowledge about Linux systems: I have downloaded some open source code, which is written in C uses complex.h, so I assume it is ANSI C99 comes with makefiles designed for compilation…
Michael
  • 270
  • 2
  • 12
-1
votes
1 answer

How to run C codes in matlab

I want to run a c++ code in Matlab, in my code I have this int max=(int)*mxGetPr(prhs[0]); double a[max]; but when I use mex it has these errors error C2057: expected constant expression error C2466: cannot allocate an array of constant…
amanda
  • 23
  • 1
  • 7
-1
votes
2 answers

Undefined reference to shared library functions after converting from C to C++

I have a shared library `libsharedlib.so' which used to be generated from C files. Since the library now needs to use functions from a 3rd party C++ library, I would like to convert my shared library from C to C++ (the code is relatively simple).…
lodhb
  • 869
  • 2
  • 11
  • 28
-1
votes
1 answer

Error LNK2019: unresolved external symbol in matlab

I have been at this for 2 days and have tried every possible solution I can find via a search engine. But I still am stuck here. I downloaded a package for superpixel implementation from here. The function is in C++, but a mex file has been…
Lakshmi Narayanan
  • 4,550
  • 13
  • 42
  • 84
-1
votes
1 answer

Regarding Mex & WSDL issue in WCF

What is the importance of this setting httpGetEnabled="false" or httpGetEnabled="true" what will happen if we set httpGetEnabled="false" suppose if I want any .Net 2.0 client can consume my wcf service which has been developed by .Net 4.0 then how…
Mou
  • 13,749
  • 38
  • 131
  • 248
-1
votes
1 answer

how to call a matlab/octave function from GTK+2 C code

how a built-in matlab/octave function can be called from a GTK+2 C code. i know how to call octave functions from C code by Mex files, but i don't know how i can call matlab/octave function from GTK+2 C code. is it possible to use Mex files to call…
user3132152
  • 103
  • 4
-1
votes
1 answer

Accessing real and imaginary parts of cusp::complex vector

I need to access the real and imaginary parts of a cusp::complex type vector, for the purpose of sending it to a matlab variable through, mex. How do I access the real and imaginary parts separately of a vector of type. …
-1
votes
1 answer

How to read mex.c file in Matlab code

I have a Matlab code for measurement and when I try to run it this error pops up: Undefined function `mexLoadMeasurements` for input arguments of type `char`. Error in LoadMeasurements (line 56) measurements = mexLoadMeasurements(attr.Name); I…
Sam
  • 377
  • 1
  • 4
  • 14
-1
votes
2 answers

MATLAB mex c + Fortran Error

I'm trying to mex a project made up of files written in c and fortran. In order to make it easy I created this simple funcions: mysum.f SUBROUTINE mysum(a,b) REAL :: a,b,r r = a+b WRITE(*,*) r END SUBROUTINE mysum and test.c #include…
user2279697
  • 713
  • 1
  • 6
  • 10
1 2 3
95
96