rsmenon / MATLink

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

Matlab's path does not include directories in MATLABPATH Environment Variable #94

Closed modisio closed 7 years ago

modisio commented 7 years ago

Workaround: Use matlab's startup.m, not the environment variable

This is how to see the issue:

szhorvat commented 7 years ago

I am unable to reproduce this problem on OS X.

Are you sure that the MATLABPATH variable exists in your environment when running Mathematica? It may have gotten "lost" at some point.

Check this with GetEnvironment["MATLABPATH"] in Mathematica.

szhorvat commented 7 years ago

Please let us know your operating system too.

modisio commented 7 years ago

This is on Windows. MATLABPATH is a defined User Environment variable in "System Properties". It is picked up by matlab, and is showing up in a shell (echo $MATLABPATH). And yet GetEnvironment["MATLABPATH"] in Mathematica returns None.

szhorvat commented 7 years ago

This confirms that the problem is not with MATLink.

It is either with the way you set the variable, or with the way you started Mathematica (e.g., are you running it under the same user account for which you set the variable? Did you fully restart Mathematica after editing environment variables?)

I double checked that Mathematica picks up environment variables (both user and system ones) on Windows (Windows 10 / M11.1.1). If it didn't, MATLink couldn't even work, as it relies on the appropriate directories being added to the PATH variable.

Since this turned out not to be MATLink related, I am closing this issue.

szhorvat commented 7 years ago

If you find that Mathematica is not picking up any changes to environment variables, even after restarting the front end, I recommend asking about the problem at http://mathematica.stackexchange.com/