problems calling matlab from command line in OS X

1 vue (au cours des 30 derniers jours)
Robert
Robert le 22 Août 2011
Hi. I installed Matlab 2011a before removing 2009a. After the installation '$which matlab' pointed to /usr/bin/matlab, which called 2009a.
Now I've removed 2009a (just deleted it from Applications) and '$which matlab' is blank.
'$ls /usr/bin/matlab' shows a file, but Finder doesn't see it when I navigate to /usr/bin/.
How do I get '$matlab' to call 2011a?
  1 commentaire
Robert
Robert le 22 Août 2011
Thanks Kelly and Daniel. ls -l showed that /usr/bin/matlab pointed to the deleted 2009a version.
Daniel's advice worked. Here are the exact commands I used, in case someone else has this problem:
$ sudo rm /usr/bin/matlab
$ sudo ln -s /Applications/MATLAB_R2011a.app/bin/matlab /usr/bin/matlab
Of course, you'll likely have to modify the path(s) above.

Connectez-vous pour commenter.

Réponse acceptée

Daniel Shub
Daniel Shub le 22 Août 2011
I am a Linux user and sometimes there are odd differences between Linux and Mac, but you should be able to just recreate the symbolic link. From the command line as a privileged user you would want to do something like:
ln -s /usr/local/matlab/r2011a/bin/matlab /usr/bin/matlab
with /usr/local/matlab/r2011a/bin/matlab tailored to be your install directory.

Plus de réponses (1)

Kelly Kearney
Kelly Kearney le 22 Août 2011
The /usr/bin/matlab file should be a symbolic link; do an ls -l to see where it's pointing (should point to <matlabroot >/bin/matlab). In my experience this link always updates to the most recently installed version of Matlab (I never uninstall my previous versions), though it would seem something went wrong on your most recent install.
Can't recall whether Finder shows symbolic links by default or not... they show up in mine, but I may have altered preferences for this.
You might want to try reinstalling the new version of Matlab, and see if the link resurrects itself. Not sure if manually creating it (via ln) would do more harm than good.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by