Path: news.mathworks.com!not-for-mail
From: "Dan Haeg" <haegd@msoe.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: M files must be run twice for changes to take effect on linux system
Date: Thu, 20 Sep 2007 22:38:07 +0000 (UTC)
Organization: Milwaukee School of Engineering
Lines: 21
Message-ID: <fcusof$ep$1@fred.mathworks.com>
References: <fcul58$kac$1@fred.mathworks.com>
Reply-To: "Dan Haeg" <haegd@msoe.edu>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190327887 473 172.30.248.36 (20 Sep 2007 22:38:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 20 Sep 2007 22:38:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 475291
Xref: news.mathworks.com comp.soft-sys.matlab:429517



"Tim " <timtjanssen@yahoo.com> wrote in message
<fcul58$kac$1@fred.mathworks.com>...
> 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!

I ran into a similar problem on windows. I wrote a function
that writes a script using fprintf. The last line in the
function runs the script which has been closed with fclose.
It does not run the current version of the script though. If
I run the script from the command line the current one gets run.