[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fsolve inside fsolve
From: |
Brian Bucher |
Subject: |
fsolve inside fsolve |
Date: |
Sat, 04 Feb 2006 15:58:38 -0500 |
User-agent: |
Thunderbird 1.5 (Macintosh/20051201) |
Greetings,
I'm attempting to use fsolve to solve for something inside a function
that was itself called with fsolve. I'm getting
error: fsolve: invalid recursive call
The playing field:
OS: Mac OS X 10.3.9
Octave version: 2.1.53-1 installed via Fink (FinkCommander)
octave:11> call_bname2
yguess = 0.50000
xguess = 0.50000
error: fsolve: invalid recursive call
error: called from `bname2' in file `/Users/blah/octave_playing/bname2.m'
error: fsolve: evaluation of user-supplied function failed
error: near line 5 of file `/Users/blah/octave_playing/call_bname2.m'
octave:11>
--- file call_bname2.m ---
yguess = 0.5
[y, binfo] = fsolve('bname2', yguess)
--- file bname2.m ---
function g = bname2(yin)
xguess = 0.5
[x, info] = fsolve('bname', xguess)
g = 0.7 - yin
endfunction
--- file bname.m ---
function f = bname(xin)
f = 0.8 - xin
endfunction
Is there any way to do this?
Thank you,
Brian
-------------------------------------------------------------
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
-------------------------------------------------------------
- fsolve inside fsolve,
Brian Bucher <=