[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing scripts
From: |
James Sherman Jr. |
Subject: |
Re: Writing scripts |
Date: |
Sat, 8 Dec 2007 17:35:47 -0500 |
> As you can see I have called the "plotgraph" function from within
> "lobf". With the intent that x=data(:,1) that was defined from
> "plotgraph".
>
> Once I have defined a value in one function how can it be persistant
> in octave once the function has ended?
You can't have it persist, since all variables inside functions are
local. On the other hand, you can have it return a value that you
wish to use later on, such as x and y from your plotgraph function.
In your lobf function, simply call plotgraph like this:
[x, y] = plotgraph( file, "*" );
and x and y will be what is returned by plotgraph.
- Writing scripts, Ciaran Mooney, 2007/12/08
- Re: Writing scripts,
James Sherman Jr. <=