help-octave
[Top][All Lists]
Advanced

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

return values in functions


From: Jonathan Drews
Subject: return values in functions
Date: Thu, 5 Apr 2001 21:38:10 -0500

Hi:

 I am trying to assign the value of a function by using the following:

octave:1> function z = g(x,y)
> z = exp(-0.52*x)*cos(8*3.14159*y);
> endfunction
octave:2>
octave:2> g(2,3)
ans = 0.35345
octave:3>
octave:3> z
error: `z' undefined near line 3 column 1
error: evaluating expression near line 3, column 1
octave:3>                              


 Is my install of Octave defective or am I doing this wrong. I am using 
version 2.0.16.
-- 
                                                Cheers,
                                                Jonathan



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