help-octave
[Top][All Lists]
Advanced

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

Re: lsode example: different info results?


From: c.
Subject: Re: lsode example: different info results?
Date: Mon, 13 Dec 2010 13:16:47 +0100

On 13 Dec 2010, at 13:05, Richard O. Legendi wrote:

> Hi all,
> 
> I would ask another question about the `fsolve()` function. I tried to 
> execute the following example found in the Octave manual:
> 
>       http://sunsite.univie.ac.at/textbooks/octave/octave_19.html

Why are you looking at that page rather than at the official octave manual:
http://www.gnu.org/software/octave/doc/interpreter/Nonlinear-Equations.html#Nonlinear-Equations
?

> It says that I should get `info = 1` as a result. However, when I 
> execute the statements I get the following (different) result:
> 
> octave:1> function y = f (x)
>>  y(1) = -2*x(1)^2 + 3*x(1)*x(2)   + 4*sin(x(2)) - 6;
>>  y(2) =  3*x(1)^2 - 2*x(1)*x(2)^2 + 3*cos(x(1)) + 4;
>> endfunction
> octave:2> [x, info] = fsolve ("f", [1; 2])

The manual you are looking at refers to a VERY old version of Octave (2.0.13, 
that's from about 13 years ago!! and it was not even an official stable 
release!!) which is most likely not the one you have installed.
The manual for 3.2.4 I linked above describes the new calling sequaence:

[x, fvec, info] = fsolve ("f", [1; 2])

HTH,
c.


reply via email to

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