After installing MATLAB2012b and starting it, the folder MATLAB
gets created under ~/Documents/
.
I want this MATLAB
folder to be created in other directory, for example ~/Documents/workspace
.
What should I do?
in my case i install matlab in this directory /usr/local/MATLAB/R2012a
then you go to /usr/local/MATLAB/R2012a/toolbox/local
ls startup.m
if you can't find the startup.m you can create this file by yourself.
the file contain syntax like this :
cd /path/your/path/you/want/matlab_work
it's work for me :)
According to source (1) you need to change the folders in the "search path" and for Linux Ubuntu I did the following (tested on R2014a
, R2014b
, R2015a-prerelease
):
This link shows you in pictures what is outlined below. (Don't have enough rep to put everything here...)
1. Open Matlab and go to "Set Path"
2. Remove
`~/Documents/MATLAB`
3. Click Add Folder...
button and select or make the folder you want to be searched by Matlab
4. Save the new pathdef.m
somewhere that you are priviliged to save things in so I chose ~/Documents
to make things easy
5. Replace the current pathdef.m
found in /usr/local/MATLAB/R20xxx/toolbox/local/pathdef.m
(xxx= your version, mine was R2014b)
6. Open Terminal
and type:
sudo cp ~/Documents/pathdef.m /usr/local/MATLAB/R2014b/toolbox/local/pathdef.m
7. Open Matlab
and click the gear and go to General (Preferences > General
) then set your new folder as the start location for every time you open Matlab
8. Delete ~/Documents/pathdef.m
file because you don't need it and will confuse you later.
12.04
or12.10
? Please remove the extra tag.