Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: "Change directory" dialog box
Date: Fri, 9 Oct 2009 14:55:25 +0000 (UTC)
Organization: Universit&#228;t Heidelberg
Lines: 14
Message-ID: <hanist$p3$1@fred.mathworks.com>
References: <haidoe$mjn$1@fred.mathworks.com> <hal2l8$25f$1@fred.mathworks.com> <hang26$11e$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255100125 803 172.30.248.35 (9 Oct 2009 14:55:25 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 9 Oct 2009 14:55:25 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869888
Xref: news.mathworks.com comp.soft-sys.matlab:576259


Dear Andre!

> > > is there any way (other than adding a line of code in every file) to set the MATLAB preferences such that the default behavior for running m-files is to change the current directory to the directory where the file is located ?

> Allow me to disagree: the pop-up dialog only shows up if you are trying to run an m-file which is located in a directory which is not included in the path. If you run FOPEN, for example, MATLAB knows where to search for it.

So I think, I did not understand, when you want to change the directory.

What do you mean by "running m-files"?

Do you mean the behaviour of the Run-Button from the editor? Then the change of the directory happens only once at pressing the button.
I meant the currently running M-file, which is a completely different story.

Kind regards, Jan