Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!t1g2000pra.googlegroups.com!not-for-mail
From: Randy Poe <poespam-trap@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: #include in matlab?
Date: Thu, 13 Dec 2007 06:59:25 -0800 (PST)
Organization: http://groups.google.com
Lines: 22
Message-ID: <f3f46ccf-34a2-4d8d-a8b9-e82f6fe62f8a@t1g2000pra.googlegroups.com>
References: <fjreq3$t02$1@fred.mathworks.com>
NNTP-Posting-Host: 192.35.37.20
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1197557966 26279 127.0.0.1 (13 Dec 2007 14:59:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Thu, 13 Dec 2007 14:59:26 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: t1g2000pra.googlegroups.com; posting-host=192.35.37.20; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.4) 
X-HTTP-Via: 1.1 squid.atl.lmco.com:3128 (squid/2.5.STABLE14)
Bytes: 1931
Xref: news.mathworks.com comp.soft-sys.matlab:442336



On Dec 13, 9:15 am, "Gus " <lottg.nos...@janelia.hhmi.org> wrote:
> I have an m file that's exceeding 6000 lines and I want to
> split it up into many separate function files so I can more
> readily browse them.
>
> Is there any way that I can create a file and somehow
> include it in the execution path so that I can still create
> function handles to subfunctions in that file from another m
> file?  Effectively, I want something like #include that I
> can use to split up a file up for a single program.

One suggestion: Write your subblocks as scripts
(no FUNCTION line), so they will execute just as if they
were written inline.

function myfun(a,b,c)
block1;
block2;
block3;
end

                - Randy