rsmenon / MATLink

Communicate with MATLAB from Mathematica
matlink.org
68 stars 14 forks source link

Cannot connect to MATLink #111

Closed jonluntzel closed 3 years ago

jonluntzel commented 3 years ago

Hi, having trouble connecting with 'Needs["MATLink`"] / OpenMATLAB[]', getting these errors: Merged_document If I ignore the errors it runs indefinitely. Both the files are located in the win64 folder that is in the path. What I tried:

Extracted the MATLink zip file in $UserBaseDirectory and ran regmatlabserver in MATLAB as an administrator, then ran those 2 lines in a notebook. Restarted Mathematica, double checked the added paths were present with 'Environment["PATH"]' and tried again.

I'm using Windows 10 64-bit, Mathematica 12.0, and MATLAB 2018b. I have C:\Program Files\MATLAB\R2018b\bin\win64 and C:...\win64\bin added as path variables. I haven't yet tried reinstalling.

szhorvat commented 3 years ago

Can you show the output of the following, after running it in a newly started Mathematica session?

Needs["MATLink`"]
MATLink`Developer`GetInfo[]
jonluntzel commented 3 years ago

Screenshot (145)

szhorvat commented 3 years ago

I am not immediately sure what is wrong. There are some problems in the PATH setting though, and while these are unlikely to be causing the problem, please do correct them.

Since Window's PATH editor is pretty inconvenient, I find it easy to copy the whole string to a text editor (like Notepad), fix it, then paste it back.


In the past, others have reported similar errors when a conflicting DLL was present somewhere in the path. Just in case, please also move all the MATLAB-related entries to right after the last entry starting with C:\Windows\....

szhorvat commented 3 years ago

Remember to fully restart Mathematica (not just the kernel) after editing the PATH, and verify that everything was fixed by looking at the output of GetInfo[].

jonluntzel commented 3 years ago

It works. Much appreciated.