Path: news.mathworks.com!not-for-mail
From: "James Wright" <jameswright1001@yahoo.co.uk>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Help speeding up/replacing loops
Date: Tue, 16 Jun 2009 17:49:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <h18lud$rpl$1@fred.mathworks.com>
References: <h18ge7$gta$1@fred.mathworks.com>
Reply-To: "James Wright" <jameswright1001@yahoo.co.uk>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245174541 28469 172.30.248.37 (16 Jun 2009 17:49:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 16 Jun 2009 17:49:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1878517
Xref: news.mathworks.com comp.soft-sys.matlab:548020


Is it even possible to replace loops like:

p(1) = B(1)*cos(C(f));
q(1) = B(1)*sin(C(f));
for n = 2:N
      p(n) = p(n-1) + B(n)*cos(n*C(f));
      q(n) = q(n-1) + B(n)*sin(n*C(f));
end


??
I'm starting to think that maybe it's not