Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: M files must be run twice for changes to take effect on linux
Date: Sat, 1 Dec 2007 05:23:29 +0000 (UTC)
Organization: UBC
Lines: 57
Message-ID: <fiqr4h$44t$1@fred.mathworks.com>
References: <fcul58$kac$1@fred.mathworks.com> <fd0hqp$4s2$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1196486609 4253 172.30.248.38 (1 Dec 2007 05:23:29 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 1 Dec 2007 05:23:29 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 162893
Xref: news.mathworks.com comp.soft-sys.matlab:440324



Thanks all for the input. Sorry for not getting back sooner.
Yes, with 'clear functions' problem is solved. I actually
was already using that. However, I don't understand why I
should use that, when I never had to before.

It turns out that the problem occurs with functions that are
in a different directory than from which I'm working
(running the primary script). For some of my programs I have
functions in subdirectories that I usually don't add to the
path, but simply jump through the directory structure using
'cd' commands. That alway worked fine, but these are the
ones that are problematic on my present matlab system. Is
there a simple explanation for this? Or is this just a
not-so-good programming practice? I can of course add the
directory structure to the path when calling the script and
be done with it (and remove after running), but just like to
know what's causing the problems that were never there before.

Thanks,

Tim




Gordon Weast <gweast@mathworks.com> wrote in message
<fd0hqp$4s2$1@fred.mathworks.com>...
> Tim,
> 
> Try executing 'clear functions' at the MATLAB prompt after
you edit
> the file.  That will clean out any cached versions of m files.
> 
> If you create a new file and put it down in the
MATLABROOT/toolbox/...
> tree somewhere, then you need to rehash or the file won't
be found.
> 
> Gordon Weast
> xPC Target Development
> The MathWorks
> 
> Tim wrote:
> > Weird question. Running Matlab r2006a on  a 64bit linux
> > system I ran into the following. Whenever I change something
> > in an m-file, the first time I then call it from the command
> > window it will not include the changes just made. I will
> > need to run it again, to have it updated. 
> > 
> > This is not only a hassle but also very problematic when
> > checking for bugs, or developing code in general. I never
> > had this before (I've ran various Matlab versions on both
> > windows, linux and unix over the last years) and I'm pretty
> > much clueless as to where this might be coming from.
> > 
> > Thanks for any input!