Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help speeding up/replacing loops
Date: Tue, 16 Jun 2009 16:36:02 +0000 (UTC)
Organization: Battelle Energy Alliance (INL)
Lines: 10
Message-ID: <h18hli$bar$1@fred.mathworks.com>
References: <h18ge7$gta$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 1245170162 11611 172.30.248.38 (16 Jun 2009 16:36:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 16 Jun 2009 16:36:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 688530
Xref: news.mathworks.com comp.soft-sys.matlab:547994


I haven't looked over your code thoroughly, but one thing stands out immediately.  Are you creating strings for comments?  If so, you would be much better off to do this:

% A comment in the code.

instead of:

'A comment in the code';


MATLAB will ignore the true comment, but process the string, which requires time and resources.