help-octave
[Top][All Lists]
Advanced

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

Re: DAE solver with additional parameters


From: Tatsuro MATSUOKA
Subject: Re: DAE solver with additional parameters
Date: Thu, 3 Jul 2014 13:30:50 +0900 (JST)




----- Original Message -----
> From: c. 
> To: lordgogi 
> Cc: address@hidden
> Date: 2014/7/2, Wed 16:53
> Subject: Re: DAE solver with additional parameters
> 
> a = 1; b = 1; c = 1;
> 
> function res = f (x, xdot, t, a, b, c)
>   global a b c
>   res = xdot + (a * b * c) * x;
> endfunction
> 
> x = daspk (@(x, xdot, t) f(x, xdot, t, a, b, c), 
>            1, -1, [0, 10]); 
> 


Perhapsthere is a typo.
The function should be

function res = f (x, xdot, t, a, b, c)
   res = xdot + (a * b * c) * x;
endfunction


The sentence  "global a b c" is not required if one use anonymous function.

Tatsuro 



reply via email to

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