help-octave
[Top][All Lists]
Advanced

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

Re: recursive function


From: Ian McCallion
Subject: Re: recursive function
Date: Wed, 31 Oct 2018 08:03:01 +0000

Sorry, there was a small but important typo in previous reply. Try this:

function ret= f(x)
    if x==1
        ret = 100;
    else
        ret = (f(x-1)+200)*1.05;
    end
end


On Tue, 30 Oct 2018 at 16:28, Ian McCallion <address@hidden> wrote:
>
> Something like
>
> function ret= f(x)
> if x==1
> ret =100;
> else
> ret ==(f(x-1)+200)*1.05;
> end
> end
> On 30 Oct 2018, at 17:02, Andrea Santiago <address@hidden> wrote:
>>
>> hello,I am new to OCTAVE. I just dont know how to put my recursive function:
>> f(1)=100
>> f(x)=(f(x-1)+200)*1.05
>> I looked for any info but none of them helped me. Thanks



reply via email to

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