Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
12.04 or 12.10? Please remove the extra tag. – Basharat Sialvi Apr 24 '13 at 21:51
up vote 1 down vote accepted

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 :)

share|improve this answer

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


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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.