Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Vector Math vs For Loop
Date: Tue, 17 Nov 2009 21:31:19 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <hdv4n7$la$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1258493479 682 172.30.248.37 (17 Nov 2009 21:31:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 17 Nov 2009 21:31:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2084273
Xref: news.mathworks.com comp.soft-sys.matlab:585944


 is it possible to calculate X when

X(i) =X(i-1) + A * (B - X(i-1) )

using a vector script instead of a loop

**Importantly "x" is not a known vector, it is only given an initial value. 
"a" is a constant
"b" is a vector (for this example lets say its rand(1000))