help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: suite


From: Mike Miller
Subject: Re: suite
Date: Sat, 11 Dec 2004 12:11:38 -0600 (CST)

On Sat, 11 Dec 2004, adel.essafi wrote:

hi list
please, how can I define a suite in octave
U(n+1)=3*U(n)+2 (for example)
and calculate u(1000)

A simple method:

n=1000;
U=zeros(1,n);
U0=4; #or whatever you want
U(1)=3*U0+2;
for i=2:n,
  U(i)=3*U(i-1)+2;
end

That would work, but there are probably much nicer ways to do this and other people will have more sophisticated ideas than mine!

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]