Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help speeding up/replacing loops
Date: Wed, 17 Jun 2009 16:26:03 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 5
Message-ID: <h1b5er$8td$1@fred.mathworks.com>
References: <h18ge7$gta$1@fred.mathworks.com> <h1ao8t$r0f$1@fred.mathworks.com> <h1apo1$kjc$1@gemini.csx.cam.ac.uk> <h1b09q$ngk$1@fred.mathworks.com> <h1b1j5$kks$1@fred.mathworks.com> <h1b4b6$nsl$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 1245255963 9133 172.30.248.38 (17 Jun 2009 16:26:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 17 Jun 2009 16:26:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:548361


"James Wright" <jameswright1001@yahoo.co.uk> wrote in message 
> I already did the pre-allocations, they're just at the very top of the program. I'm foolishly assuming I can pre-allocate them all at the start, would it actually be better to pre-allocate right before the loop?

I apologize, I didn't see that you had done this.  As long as the sizes of the variables aren't changing every time through the big outer loop, you are fine to do it there.  
Any more help I could give would depend on the input parameters.  If you post everything needed to run the code the way you normally would, I might be able to offer more.