From maintainers-request at octave dot org Thu Mar 30 09:17:44 2006 Subject: Re: Bi variate to mono variate functions From: David Bateman To: "John W. Eaton" Cc: Anglade Pierre-Matthieu , maintainers@octave.org Date: Thu, 30 Mar 2006 17:13:26 +0200 John W. Eaton wrote: >On 30-Mar-2006, David Bateman wrote: > >| I have R14sp3 installed, which I believe is the latest version as it is >| dated Feb 13, 2006. So I don't think it is fixed... > >Strange. Here is what I see with the version installed on the UW COE >systems (Version 7.1.0.183 (R14) Service Pack 3, August 02, 2005): > > >> type myfun2 > > function y = myfun2(x,c) > y = 1./(x.^3-2*x-c); > > >> p = 5 > > p = > > 5 > > >> quad ( at (x) myfun2 (x, p), 0, 2) > > ans = > > -0.4605 > > >Also, this type of behavior is documented for fsolve: > > >> help fsolve > FSOLVE solves systems of nonlinear equations of several variables. > > [...] > > To solve the system of equations for a specific value of c, first assign the value to c. Then create a one-argument anonymous function that captures > that value of c and calls myfun with two arguments. Finally, pass this anonymous > function to FSOLVE: > > c = -1; % define parameter first > x = fsolve( at (x) myfun(x,c),[-5;-5]) > > See also OPTIMSET, LSQNONLIN, at , INLINE. > > >jwe > > > Sorry my fault.. It helps if I define "p" :-) D. -- David Bateman David dot Bateman at motorola dot com Motorola Labs - Paris +33 1 69 35 48 04 (Ph) Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob) 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax) The information contained in this communication has been classified as: [x] General Business Information [ ] Motorola Internal Use Only [ ] Motorola Confidential Proprietary