octave-maintainers
[Top][All Lists]
Advanced

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

Re: Bi variate to mono variate functions


From: John W. Eaton
Subject: Re: Bi variate to mono variate functions
Date: Thu, 30 Mar 2006 10:10:25 -0500

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 (@(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(@(x) myfun(x,c),[-5;-5])

      See also OPTIMSET, LSQNONLIN, @, INLINE.


jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]