Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!n60g2000hse.googlegroups.com!not-for-mail
From:  Eric C <eric.forum@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to permanently change Matlab working directory (not search path)
Date: Tue, 10 Jul 2007 13:29:39 -0000
Organization: http://groups.google.com
Lines: 23
Message-ID: <1184074179.368747.106730@n60g2000hse.googlegroups.com>
References: <ef5cfc4.-1@webcrossing.raydaftYaTP>
NNTP-Posting-Host: 138.64.8.53
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1184074179 7738 127.0.0.1 (10 Jul 2007 13:29:39 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 10 Jul 2007 13:29:39 +0000 (UTC)
In-Reply-To: <ef5cfc4.-1@webcrossing.raydaftYaTP>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: n60g2000hse.googlegroups.com; posting-host=138.64.8.53;
Xref: news.mathworks.com comp.soft-sys.matlab:418237



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.