What are symbolic links, and why does the MATLAB installer ask if I want to create them?

442 views (last 30 days)
I would like to know what symbolic links are, and the MATLAB installer asks if I want to create them.

Accepted Answer

Mathworks支金宝app持团队
In the Unix architecture, symbolic links point to another file / script / program, such as a shortcut does in the Windows architecture. The reason the MATLAB installer offers to install them is because the /bin and /usr/bin directories are in the system path, while the MATLAB directory is not.
The /bin and /usr/bin directories contain common system programs, as well as links to other programs, so if you type a command such as 'ifconfig' from anywhere, it will check those directories (and others in the path) first.
这很方便从任何目录启动MATLAB;如果安装了链接,则无需更改为MATLAB目录即可启动MATLAB。请记住,您需要将安装程序作为“ root”运行,以安装符号链接。
In order to manually create the symbolic link, browse to the /usr/local/bin/ folder and run the following command:
Ln-s $ matlab/bin/matlab matlab
where $MATLAB is the MATLAB installation directory.
6条评论
Walter Roberson
Walter Roberson on 22 May 2018
I recommend that you put the following in your ~/.bash_profile
别名matlab =“/applications/matlab_r2018a.app/bin/matlab -nojvm -nodesktop”
Once it is there, any new interactive shells for that user will allow you to type
MATLAB
调用Matlab。您可能想使用标志:当我从命令窗口中使用MATLAB时,我想在非图形模式下使用它,这就是为什么我使用的标志。

Sign in to comment.

更多的Answers (1)

Shahbaz Hussain
Shahbaz Hussain 2020年7月1日
For whats purpose "alias matlab="/Applications sudo ln -s /Applications/MATLAB_R2018a.app/bin/matlab matlab ls: matlab: File exists alias matlab="/Applications/MATLAB_R2018a.app/bin/matlab -nojvm -nodesktop"MATLAB_R2018a.app/bin/matlab -nojvm -nodesktop" these links be used?
1 Comment
Walter Roberson
Walter Roberson 2020年7月1日
Do not combine the alias and the symbolic link. In your ~/.bash_profile put
别名matlab =“/applications/matlab_r2018a.app/bin/matlab -nojvm -nodesktop”
之后,退出该终端会话并开始新的终端会话。然后,您将能够输入
MATLAB
在终端命令提示中,它将调用MATLAB R2018A

Sign in to comment.

Tags

下载188bet金宝搏

Community Treasure Hunt

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

开始狩猎!

Translated by