Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: recursion expression in matlab
Date: Thu, 6 May 2010 10:46:52 -0400
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <hrukon$o55$1@fred.mathworks.com>
References: <hrujac$fmm$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1273157207 24741 172.31.44.65 (6 May 2010 14:46:47 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 6 May 2010 14:46:47 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Response
Xref: news.mathworks.com comp.soft-sys.matlab:633183


"nuclph nuclph" <bskorodo@gmail.com> wrote in message 
news:hrujac$fmm$1@fred.mathworks.com...
> hi all,
>
> say, i have the following recursion:
> E(s) = d^2/(3d-2) + (3d-3)/(3d-2) E(s-1)
> E(0) = 0
>
> If I want to find E(10) i need to expend recursion which will be a sum or 
> series.
>
> Can you suggest is it possible to implement such thing in matlab?

Assuming d is a constant not the differential operator, use the FILTER 
function or a FOR loop -- but remember that MATLAB uses _1_ based indexing, 
not _0_ based, so your E(0) should actually be E(1).

-- 
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ