How to use MEX files in Matlab?

11 visualizaciones (últimos 30 días)
Jab
Jab el 10 de En. de 2016
Editada: Walter Roberson el 3 de Oct. de 2017
I have some matlab codes (.m file) and its corresponding MATLAB MEX (.mexw32) file in a folder. I am new to the matlab of using mex files. I am not able to run the m files now.
Any help is appreciated.
Thanks
  4 comentarios
veerendhra kumar challa
veerendhra kumar challa el 3 de Oct. de 2017
i have the attached file in folder.i am getting the following error attempt to execute Error using mex C:\Users\VIGNAN\Downloads\__MACOSX\classify\private\meanShift1.c not found; check that you are in the correct current folder, and check the spelling of 'C:\Users\VIGNAN\Downloads\__MACOSX\classify\private\meanShift1.c'.
Error in toolboxCompile (line 21) mex([dir 'meanShift1.c'], '-outdir', dir );
i am running Windows 64-bit Matlab.
Walter Roberson
Walter Roberson el 3 de Oct. de 2017
Editada: Walter Roberson el 3 de Oct. de 2017
Why are you trying to compile a MACOSX version on MS Windows ?
I am not sure which files you are referring to as "attached file" ?

Iniciar sesión para comentar.

Respuesta aceptada

ram vanguri
ram vanguri el 10 de En. de 2016
You need to compile the c file into a mex library (in matlab).
Setup your Matlab's mex compiler:
>> mex -setup then run the .m file
  7 comentarios
James Tursa
James Tursa el 3 de Oct. de 2017
Editada: James Tursa el 3 de Oct. de 2017
Correcting an old post.
Walter's comment above is incorrect. When mexing a source file, you need to use the file name including the extension. So if you had ghoatbleet.c then you would issue the following at the command line:
mex ghoatbleet.c
If you issue the command without the .c extension, MATLAB will search for the file name without the extension, not find it, and report a file not found error.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by