[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: output variables from functions
From: |
Avraham Rosenberg |
Subject: |
Re: output variables from functions |
Date: |
Sat, 28 Mar 2009 06:19:03 +0300 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Fri, Mar 27, 2009 at 09:42:10AM +0000, Jim Maas wrote:
>
> > 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
> >
>
> Thanks Avraham,
>
> I've tried this many times, but then when I try to use this variable
> somewhere else in the script I just get an error message saying that it
> is unassigned? How can this be?
>
> Thanks
>
> Jim
>
> ----
> Jim Maas
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Hi Jim,
That sounds strange. What is the output of "whose", immediately after the
first successfull completion of the script, and immediately before its next
invocation ? Maybe you unintentionally clear the variable.
Cheers, Avraham
--
Please avoid sending to this address Excell or Powerpoint attachments.