MATLAB R2010b Mex support for Visual Studio 2013

version (5.38 KB) by Son Hua
Make MATLAB R2010b to detect C/C++ compiler in Visual Studio 2013.


Updated 2 Mar 2016

View License

This is a hack to make MATLAB R2010b to detect C/C++ compiler from Visual Studio 2013.
1. Copy three files msvc120opts.stp, msvc120engmatopts.bat, msvc120opts.bat and copy to your MATLAB. For example, copy to C:\Program Files\MATLAB\R2010b\bin\win64\mexopts" for 64-bit Windows and to "C:\Program Files\MATLAB\R2010b\bin\win32\mexopts" for 32-bit Windows.

2. In Matlab, run
mex -setup
and choose Visual Studio 2013 as the compiler.

3. Run
to test if the compiler can be called properly. If you see

MEX [option1 ... optionN] sourcefile1 [... sourcefileN]
[objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]

Use the -help option for more information, or consult the MATLAB API Guide.

C:\MATLAB\R2010B\BIN\MEX.PL: Error: No file names given.

then the compiler is found and ready to use.


P.S. This may not work for MATLAB R2013a.
You might want to use this instead:

Cite As

Son Hua (2022). MATLAB R2010b Mex support for Visual Studio 2013 (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!