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: Mon, 30 Mar 2009 03:53:01 +0000 (UTC)
Organization: University of Michigan
Lines: 27
Message-ID: <gqpfmt$8hi$1@fred.mathworks.com>
References: <fcul58$kac$1@fred.mathworks.com> <fd0hqp$4s2$1@fred.mathworks.com> <fiqr4h$44t$1@fred.mathworks.com> <gogsqd$pbe$1@fred.mathworks.com> <goh095$dlk$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 1238385181 8754 172.30.248.35 (30 Mar 2009 03:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 30 Mar 2009 03:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1544408
Xref: news.mathworks.com comp.soft-sys.matlab:528590


No, I saved it in a local directory, outside of any of the MATLAB (or my personal) paths. The exact path was something like '/Users/seth/_code/imc/suolson.m'; the file essentially creates a bunch of variables in the local workspace. Calling 
run('/Users/seth/_code/imc/suolson.m')
would work the first time after 'clear functions' or after launching MATLAB. However, calling 'run' again, after the data had been changed outside of MATLAB, did nothing. Even after I opened it in MATLAB's editor and pressed the 'run' button used the contents of the file before it had been modified. (I deleted the local workspace variables before doing this, just to make sure it actually was running.)

With the previously mentioned workarounds, and with my beginning to transition to other data analysis and plotting utilities, the issue is less important to me now.

Thanks,
Seth

"Steven Lord" <slord@mathworks.com> wrote in message <goh095$dlk$1@fred.mathworks.com>...
> 
> 
> Where did you save this M-file?  If you saved it in a directory under 
> $MATLABROOT/toolbox, then we strongly recommend you save it elsewhere.
> 
> http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f8-28521.html
> 
> If you didn't save it under the toolbox directory, did you save it on a 
> network drive?  If the network drive doesn't inform MATLAB that the file has 
> changed promptly (or at all), MATLAB may not learn that the function has 
> changed until you clear it from memory, at which time MATLAB has to ask the 
> network drive for a new copy of the function to load into memory.
> 
> -- 
> Steve Lord
> slord@mathworks.com 
>