help-octave
[Top][All Lists]
Advanced

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

address@hidden: Re: moving calculation of a variable outside of function


From: Avraham Rosenberg
Subject: address@hidden: Re: moving calculation of a variable outside of function]
Date: Thu, 26 Mar 2009 06:42:27 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

----- Forwarded message from Ivan Sutoris <address@hidden> -----

From: Ivan Sutoris <address@hidden>
Subject: Re: moving calculation of a variable outside of function
Date: Wed, 25 Mar 2009 23:15:58 +0100
Cc: address@hidden
To: address@hidden

2009/3/25 Jim Maas <address@hidden>:
> 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
address@hidden
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.


reply via email to

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