[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
quad function problems and parameter passing
From: 
John W. Eaton 
Subject: 
quad function problems and parameter passing 
Date: 
Sun, 21 May 2000 10:49:23 0500 (CDT) 
On 20May2000, William Peters <address@hidden> wrote:
 I am having trouble using the quad function. The first time I invoke the
 function it works fine, but afterwards it gives an error. For example:

 octave:1> quad('sin',0,pi)
 ans = 2
 octave:2> quad('sin',0,pi)
 error: quad: invalid recursive call
 error: evaluating index expression near line 2, column 2

 I am using version 2.0.15. Is this a bug that has been fixed in later
 versions?
Yes, it is fixed in 2.0.16.
 Another question: Is there a way to pass additional parameters to funtions
 when using quad or fsolve?
Yes, you can use global variables.
If you want to pass them in the argument list to quad or fsolve, then
you can modify Octave's quad and fsolve functions to allow it to
work. Someone did this for fsolve (I think) and submitted the patch
some months ago, but it needs some work before I will include it in
the Octave sources I distributed. Plus, it should be done for the
other functions that accept usersupplied functions as arguments.
Would you like to help with this project?
Thanks,
jwe

Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
