Adding Matlab to my Path (Mac)

Hello everyone! I have been trying to add matlab to my path, but to no avail. This is what my current path looks like:
but when I type in "matlab" or "./matlab", I keep getting the error message "no such file or directory". Is there something else I need to include? Thanks!
EDIT: Once adding matlab to my path, can I run mcc to create makefiles as long as I have the compiler installed?

3 个评论

Do you need it to be on your path for applications launched by clicking on them? Or for use from shell scripts invoked from programs? Or for use from Terminal? Which login shell are you using?
you might try just '/Applications/MATLAB_R2020a.app/bin' on the path, without the executable name and the flag/options, and then try 'which matlab' to see if it's found.
Okay, that worked, thank you all!

请先登录,再进行评论。

回答(1 个)

Uday
Uday 2023-3-15

0 个投票

The best way to achieve this is to symlink your binary in /usr/local/bin dir as this is already included in your path. (This comes from the pattern that homebrew uses & is widely accepted practise.)
$ sudo ln -s /Applications/MATLAB_R2023a.app/bin/matlab /usr/local/bin
There by you can invoke MATLAB on terminal with $ matlab
If you want to see your symlinks on usr/local/bin, just do $ ls -la /usr/local/bin

类别

帮助中心File Exchange 中查找有关 Startup and Shutdown 的更多信息

产品

版本

R2020a

标签

提问:

2020-5-6

回答:

2023-3-15

Community Treasure Hunt

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

Start Hunting!

Translated by