help-octave
[Top][All Lists]
Advanced

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

Re: passing parameters to a funcion with lsode


From: roger baig viñas
Subject: Re: passing parameters to a funcion with lsode
Date: Mon, 18 Oct 2004 11:55:05 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; ca; rv:1.0.0) Gecko/20020530

Geordie,

That's the way I though it could be solved, but I don't like the idea of using global variables, basically for two reasons: first because then functions can't be reused if I don't use the same name for that variables defined as global, and second, because I've alway been thougth that global vars must be avoid (basically due to the first argument, I think).

Any other solution to pass parameters to a function called by lsode.

P.S. thanks any way. If I don't fine any other way to do it I'll use your suggestion.

En/na Geordie McBain ha escrit:
This can be done quite easily with global variables.  Declare the
parameters global at the top level and inside the function.  Set them at
the top level before the function is called.  Then your function can be
unary, as required by lsode.

See 'Variables/Global variables' in the manual for further details.

On Mon, 2004-10-18 at 04:17, roger baig viñas wrote:

I would like to know if it is possible to pass parameters to the function that is called from lsode, and if it is, how can i do it.

I should use lsode like follows:

Xd=lsode("dxdt_tancDoble_mf",x_0,t)

with dxdt_tancDoble_mf function that has a header like:

function dxdt=dxdt_tancDoble_mf(t,x,u,param)


Thank you very much



-------------------------------------------------------------
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
-------------------------------------------------------------








-------------------------------------------------------------
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]