- Mathematica version 8.0.4 or higher
- MATLAB R2011a (version 7.12) or higher
- A version of Windows/Linux/OS X that can run both Mathematica and MATLAB
MATLink has been extensively tested with Mathematica versions 8.0.4, 9.0.1 and 10.0.0, MATLAB 2012b, 2013a and 2013b on OS X 10.8 and 10.9, and moderately tested on Windows 8 and Ubuntu 13.04. If you encounter any issues with a relatively modern operating system or a supported Mathematica/MATLAB version, please open a new issue at GitHub.
Warning: On OS X and Linux, MATLAB R2014a contains a bug that breaks MATLink. Please use an different version of MATLAB with MATLink on these systems. Older or newer versions (R2013b or R2014b) are not affected by the problem. The Windows version of MATLAB R2014a is not affected by this problem and works well with MATLink.
Next: Choose your preferred download option and install MATLink
Download and install MATLink to a location in Mathematica's $Path. You can do so in one of the following ways:
Download the zip file
The zip file will always contain the most up-to-date stable version.
Download the zip file and extract the contents to the folder opened by
SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}]
Next: Select your operating system and follow the instructions to link with MATLAB.
Windows
Although MATLink ships with pre-compiled binaries, depending on your specific setup, it might be necessary to manually change a few settings before you can begin to use MATLink. If it does not work out of the box, please try following the instructions below:
- Add MATLAB's
bin\win64directory (bin\win32for 32-bit versions) to the operating system'sPATHenvironment variable. - Register the default MATLAB version by running
regmatlabserverin MATLAB. On most Windows systems, you will need administrator rights to do this. If you're using a 32 bit MATLAB (such as a student version) with a 64 bit Mathematica, then evaluate the following before using
OpenMATLAB[]for the first time (needs to be done only once)Needs["MATLink`"] SetOptions[MATLink, "Force32BitEngine" -> True]
If you reset your Mathematica settings or remove MATLink's
init.min$UserBaseDirectory/ApplicationData/MATLink, then the above option will need to be set again.
You should now be all set to use MATLink! If for some reason it fails, please open a new issue on GitHub.
Linux
Although MATLink ships with pre-compiled binaries, depending on your specific setup, it might be necessary to manually change a few settings before you can begin to use MATLink. If it does not work out of the box, please try following the instructions below:
- To run the MATLink engine, you must have the C shell
cshinstalled at/bin/csh(more info). - A C++ compiler is needed to compile the MATLink binary. Old versions of
gcccannot be used to compile MATLink. The compiler requirements depend on your version of MATLAB and are documented by the MathWorks. - Development libraries for
libuuidmust be installed. - Both Mathematica and MATLAB must be on the system
PATH(i.e.,which matlabandwhich mathreturn the correct locations).
You should now be all set to use MATLink! If for some reason it fails, please open a new issue on GitHub.
OS X
Although MATLink ships with pre-compiled binaries, depending on your specific setup, it might be necessary to manually change a few settings before you can begin to use MATLink. If it does not work out of the box, please try following the instructions below:
- Navigate to the
MATLink/Engine/bin/MacOSX64directory, edit the filemengine.shand set the path to the MATLAB app bundle. This is not necessary if MATLAB is installed in the default folder in/Applications(e.g./Applications/MATLAB_R2013a.app)
You should now be all set to use MATLink! If for some reason it fails, please open a new issue on GitHub.