[ivan.sutoris at gmail.com: Re: moving calculation of a variable outside of function]
Avraham Rosenberg
for.avraham at gmail.com
Wed Mar 25 23:42:27 CDT 2009
----- Forwarded message from Ivan Sutoris <ivan.sutoris at gmail.com> -----
From: Ivan Sutoris <ivan.sutoris at gmail.com>
Subject: Re: moving calculation of a variable outside of function
Date: Wed, 25 Mar 2009 23:15:58 +0100
Cc: help-octave at octave.org
To: jimmaas at vodafoneemail.co.uk
2009/3/25 Jim Maas <jimmaas at vodafoneemail.co.uk>:
> In the following code, is there a way to move the calculation of "ca" to a
> place outside the function, such that it's value will be available to other
> functions as well? This current code works for a single pool but I want to
> expand it to several pools and will need to use the same value of ca in
> other functions?
>
> Thanks
>
> Jim
>
>
> ----
> Jim Maas
You can use ca as global variable by adding line "global ca" both to
main script and the function (then it's value will be set every time
the function is called, and it would bea vailable to ther functions -
you need to add "global ca" also there)
Ivan Sutoris
_______________________________________________
Help-octave mailing list
Help-octave at octave.org
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
----- End forwarded message -----
Or you can include the value of this variable to the array of results that
it returns: instead of y=f(x), use [x,y]=f(x).
Cheers, Avraham
--
Please avoid sending to this address Excell or Powerpoint attachments.
More information about the Help-octave
mailing list