Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re:
Date: Thu, 13 Sep 2007 16:20:00 +0000 (UTC)
Organization: Carnegie Mellon
Lines: 35
Message-ID: <fcbnvg$94q$1@fred.mathworks.com>
References: <fcbnen$rdu$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1189700400 9370 172.30.248.36 (13 Sep 2007 16:20:00 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Sep 2007 16:20:00 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688548
Xref: news.mathworks.com comp.soft-sys.matlab:428381



You mean you are running matlab scripts. All you have to do
is call the script wherever you want to 'include' it. i.e in
in test.m if you want to run the other script , say file1.m
at say line 20 just call it by typing file1 ; 
Ofcourse, file1 must be in a directory thats in your path
variable, otherwise you will have to specify the full
pathname instead of just file1;

~S

"Henrik " <henrikNOSPAM@lanl.gov> wrote in message
<fcbnen$rdu$1@fred.mathworks.com>...
> Hey
> I was wondering if matlab supports adding all text from a
> .m-file (not a function file just code that runs buy it
> self) to another .m file that I'm running.
> Like php scripts that you can import anywhere in your php
> file buy just typing include(FILENAME). 
> So I have a file test.m that is a function. I call it
> test(obj) and it starts running. It comes to an "include"
> statement and it just keeps running through the included
> file with all it's calculations and stuff and when it comes
> to the end of the file it just continues in the test file
> with the line after the "include" statement.
> 
> Why I need this. I get files from another guy that is
> written as just code and I like to be able to run the file
> in my code without changing anything in his file since he is
> updating it all the time to a CVS system...so I can't change
> the file everytime he puts up a new file. 
> 
> Thanks 
> HS 
>