help-octave
[Top][All Lists]
Advanced

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

Re: Octave_doc.pdf


From: Martin Helm
Subject: Re: Octave_doc.pdf
Date: Fri, 24 Dec 2010 13:44:58 +0100

Am Freitag, den 24.12.2010, 09:05 +0100 schrieb Salvatore Amico:
> Hallo,
> 
> Ich habe Octave erst seit einer Woche installiert und habe die Bsp im Pdf 
> ausprobiert:
> 
> 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
> function J = jacobian (x)
> J(1,1) = 3*x(2) - 4*x(1);
> J(1,2) = 4*cos(x(2)) + 3*x(1);
> J(2,1) = -2*x(2)^2 - 3*sin(x(1)) + 6*x(1);
> J(2,2) = -4*x(1)*x(2);
> endfunction
> [x, fval, info] = fsolve (address@hidden, @jacobian}, [1; 2]); #???
> 
> Und erhalte diesen Fehler:
> -> error: xnorm: wrong type argument `cell' ???
> 

I cannot reproduce this error with octave 3.3.54, which version of
octave are you running?

> 2.
> f1a = @(x, y, z) x*2+y*z-5;
> f1b = @(x, y, z) x+y*2+y*z+8;
> f1c = @(x, y, z) x*2+y*z+z*z-15;
> [x, y, z, fval, info] = fsolve (address@hidden, @f1b, @f1c}, [1; 2; 3])
> -> error: xnorm: wrong type argument `cell'
> 

You defined the f1a and so on as anonymous functions that means your
variable f1a is already a function handle and you cannot use @f1a in the
parameter list for the call.


> 3.
> f = @(x) x*x-5;
> [x, fval, info, output] = fzero (@f, 0.5, FunValCheck)
> -> Syntax error: FunValCheck
> 

The same here, use f as parameter not @f

[x, fval, info, output] = fzero (f, 0.5)

what is FunValCheck in your example?

> Was mache ich falsch?
> 
> 
> Gruss Salvi
> 




reply via email to

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