how to open mex file in MATLAB

117 views (last 30 days)
Roy Francis
Roy Francis on 5 May 2013
Commented: MikCh on 5 May 2023
I have a file with .mexglx and .mexw32 extension. I need to run this files in MATLAB R2012a 32-bit. Is there any possible converter available or any other solution to it.
Thanking you in Advance,
Regards

Accepted Answer

Jan
Jan on 5 May 2013
You cannot convert the compiled Mex files, but you can run them directly as if they were M-files. But the file extension must match your operating system and Matlab version, see http://www.mathworks.com/help/matlab/ref/mexext.html and follow the "Tips".
  3 Comments
Rik
Rik on 19 Jun 2019
Once you have a file with that extension you should be able to use it as a normal function.
Also Mac is a Unix system.
Stelios Fanourakis
Stelios Fanourakis on 20 Jun 2019
Yes I pressed
mexext.sh
But it didn't help me either.

Sign in to comment.

More Answers (1)

MikCh
MikCh on 4 May 2023
Hi!
I have a similar issue. I need to run some functions that call two files having the extension "name1_mex.mexw64" or "name2_mex.mexw32".
I tried to replace these extensions with ".sh" but I get back an error saying: "Unrecognized function or variable 'name1_mex'."
Is there any solution to that?
Operating system: macOS 13.3.1
Matlab version: R2019b
  2 Comments
Steven Lord
Steven Lord on 4 May 2023
Neither of those MEX-files will run on Mac OS. MEX-files are architecture specific and the extension indicates the architecture for which they were built. The file with extension .mexw64 is for use on 64-bit Windows and the .mexw32 file is for use on 32-bit Windows (and so can't be run on any release past release R2015b, the last release of MATLAB for 32-bit Windows.)
You will need to either ask whoever gave you the MEX-files to give you a file compiled for Mac, which should have the extension maci64 (if you're using an Intel-based Mac) or maca64 (if you're using the Apple Silicon beta), or ask them for the source code and create the MEX-file yourself using the mex command.
MikCh
MikCh on 5 May 2023
Thank you @Steven Lord, I appreciate your detailed reply!

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!