Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Vector Math vs For Loop
Date: Wed, 18 Nov 2009 22:37:05 +0000 (UTC)
Organization: PatientsLikeMe
Lines: 19
Message-ID: <he1suh$1io$1@fred.mathworks.com>
References: <hdv4n7$la$1@fred.mathworks.com> <hdv75f$2s4$1@fred.mathworks.com> <hdv8ie$th$1@fred.mathworks.com> <he1ajj$b7a$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 1258583825 1624 172.30.248.38 (18 Nov 2009 22:37:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 18 Nov 2009 22:37:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1841757
Xref: news.mathworks.com comp.soft-sys.matlab:586252


"happydude " <anonymousse@hotmail.com> wrote in message <he1ajj$b7a$1@fred.mathworks.com>...
> thank you so much for trying this problem... 
> i couldnt help but get a little confused sorry !
> 
> in your code you have 
> B=0.5
> but B is actually a vector? 
> 
> also in the equation the current value of "x" depends on a previous value of "x", which hasn't been asigned an initial value in the code?

happydude,

You are not being careful enough about notation.  When I used the variable "B", that is because YOU called a (scalar) variable B.  This is NOT the same as the B used in the MATLAB documentation, which is indeed a vector as you point out.

Also, the filter function is more general than you need, with two separate vector inputs (which are called x and y in the documentation).  You have have only one vector.  The starting value of your vector is encoded into the inputs to the function.

I hope that helps.

the cyclist