how to open mex file in MATLAB
72 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Jan
2013-5-5
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 个评论
Rik
2019-6-19
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
2019-6-20
Yes I pressed
mexext.sh
But it didn't help me either.
更多回答(1 个)
MikCh
2023-5-4
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 个评论
Steven Lord
2023-5-4
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.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!