problems calling matlab from command line in OS X

4 次查看(过去 30 天)
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 个评论
Robert
Robert 2011-8-22
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.

请先登录,再进行评论。

采纳的回答

Daniel Shub
Daniel Shub 2011-8-22
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.

更多回答(1 个)

Kelly Kearney
Kelly Kearney 2011-8-22
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.

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by