help-octave
[Top][All Lists]
Advanced

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

Re: Functions and handles


From: Juan Pablo Carbajal
Subject: Re: Functions and handles
Date: Fri, 6 Jun 2014 22:42:35 +0200

On Fri, Jun 6, 2014 at 7:33 PM, Fausto Arinos de A. Barbuto
<address@hidden> wrote:
> function xdot = f(x,t)
>     r = 0.25;
>     k = 1.4;
>     a = 1.5;
>     b = 0.16;
>     c = 0.9;
>     d = 0.8;
>     xdot(1) = r*x(1)*(1 - x(1)/k) - a*x(1)*x(2)/(1 + b*x(1));
>     xdot(2) = c*a*x(1)*x(2)/(1 + b*x(1)) - d*x(2);
> endfunction

r = 0.25;
k = 1.4;
a = 1.5;
b = 0.16;
c = 0.9;
d = 0.8;
f = @(x,t) [r*x(1)*(1 - x(1)/k) - a*x(1)*x(2)/(1 + b*x(1)); xdot(2) =
c*a*x(1)*x(2)/(1 + b*x(1)) - d*x(2)];

Does that suits you?



reply via email to

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