MATLAB: Change Location of MATLAB Files

changedirectoryMATLAB

I installed the contents of MATLAB into my /home/username folder without thinking about the fact that it would clutter the entire folder. I would like to move the contents into another directory, for example /home/username/MATLAB. When I do this the command line reads /home/username/bin/matlab: No such file or directory. I understand this was a crude attempt to organize the contents, but how would I go about solving this problem?

Best Answer

How are you invoking MATLAB ?
If you are invoking it using the command
matlab
then use
which matlab
If it gives you a path in response, then use "ls -l" with that path and you will probably find that it is a symbolic link that needs to be updated.
If you are using the command matlab but which matlab shows nothing, then give the command
alias matlab
You might see something like
alias matlab='/home/username/bin/matlab'
if you do then your shell profile is setting up an alias . For example my ~/.bash_profile contains
alias matlab="/Applications/MATLAB_R2018a.app/bin/matlab -nojvm -nodesktop"
If I were to update this in the file, to get it to work in the same shell session I would have to use the shell command
. ~/.bash_profile
Related Question