Thread Subject: How to permanently change Matlab working

Subject: How to permanently change Matlab working

From: Ali Abuelmaatti

Date: 10 Jul, 2007 08:39:26

Message: 1 of 8

Hi All,

Does any one now how to permanently change the Matlab working
directory from the c:\Program Files\MATLAB704\work that it comes with
as default. Please note that I do mean the working directory not the
search path. I mean the directory that it goes to first when you go
file>open or file>save and so on.

Thanks in advance.

Subject: How to permanently change Matlab working direc

From: GUI

Date: 10 Jul, 2007 08:45:22

Message: 2 of 8

Ali Abuelmaatti wrote:
>
>
> Hi All,
>
> Does any one now how to permanently change the Matlab working
> directory from the c:\Program Files\MATLAB704\work that it comes
> with
> as default. Please note that I do mean the working directory not
> the
> search path. I mean the directory that it goes to first when you go
> file>open or file>save and so on.
>
> Thanks in advance.
 
You can use the "cd" command.
Example: "cd d:\stuff\univ"

Subject: How to permanently change Matlab working direc

From: Jeremy Smith

Date: 10 Jul, 2007 09:14:37

Message: 3 of 8

Try changing the "Start In" and the "Target" fields of the executable
icon.

Target: "C:\Program Files\MATLAB\R2007a\bin\matlab.bat" -sd
"C:\SomeDirectory\"

Start In: "C:\Some Directory\"

The "Target" field is probably more important.

Jeremy

Subject: How to permanently change Matlab working directory (not search path)

From: Eric C

Date: 10 Jul, 2007 13:29:39

Message: 4 of 8

On Jul 10, 8:39 am, "Ali Abuelmaatti" <ali.abuelmaa...@elec.gla.ac.uk>
wrote:
> Hi All,
>
> Does any one now how to permanently change the Matlab working
> directory from the c:\Program Files\MATLAB704\work that it comes with
> as default. Please note that I do mean the working directory not the
> search path. I mean the directory that it goes to first when you go
> file>open or file>save and so on.
>
> Thanks in advance.

I use the startup.m file. Look up the documentation from matlab using

doc startup

Basically you create an m file called startup.m and place it in the
correct path. Anytime Matlab is started the file will execute. I also
use it to do things like change the line color ordering, place grids
on the plots, suppress certain errors, etc. Use the 'cd' command (I
use the functional version) to change the directory to what you want
whenever Matlab is started.

Subject: How to permanently change Matlab working

From: C H

Date: 14 Nov, 2007 17:58:26

Message: 5 of 8

If you still can't get it to work and it gives you a "too
many arguments" error (for example, "My Documents"), try this.

Type in:

d:\student\MYDOCU~1\HOMEWO~1

Where the actual path would be d:\student\My Documents\Homework

Basically, if the string is greater than 8 characters, it'll
tell you "too many arguments", so just take the first six
letters (exclude spaces) and then a ~1 after that. Should
work as long as there's not another folder with the same
starting six characters.

Subject: How to permanently change Matlab working

From: C H

Date: 14 Nov, 2007 18:07:34

Message: 6 of 8

"C H" <fuckthemounties@canadasucks.com> wrote in message
<fhfd02$65v$1@fred.mathworks.com>...
> If you still can't get it to work and it gives you a "too
> many arguments" error (for example, "My Documents"), try
this.
>
> Type in:
>
> d:\student\MYDOCU~1\HOMEWO~1
>
> Where the actual path would be d:\student\My
Documents\Homework
>
> Basically, if the string is greater than 8 characters, it'll
> tell you "too many arguments", so just take the first six
> letters (exclude spaces) and then a ~1 after that. Should
> work as long as there's not another folder with the same
> starting six characters.



Additionally: if there are 2 or more folders starting with
the same six characters (for example, I had "fall 2007",
"fall 2006", and "fall 2005"), then the number after the ~
would be the number of folder in alphanumerical order. So,
in order the folders would be sorted Fall 2005, Fall 2006,
and Fall 2007. Fall 2007 would be the third folder starting
with "FALL20", so the command would be "FALL20~3".

Subject: How to permanently change Matlab working

From: C H

Date: 14 Nov, 2007 18:14:37

Message: 7 of 8

Found a MUCH easier way in Windows XP - Just get the
directory and change all shortcut icons you would click on
to the path you want for "start in".

Subject: How to permanently change Matlab working

From: Steven

Date: 11 Oct, 2008 20:54:01

Message: 8 of 8

It becomes much easier than this: I hate to startup in my documents to change the path use this command

userpath('C:\MATLAB\work')

you only have to do this once, I think on older versions this doesn't works so you need to edit pathdef.m

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
offensive language Tim Davis 2 Dec, 2007 20:44:14
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com