[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use a returning vector function inside another returning vect
Re: How to use a returning vector function inside another returning vector function ?
Mon, 31 Jul 2017 10:42:15 -0700
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1
On 2017-07-31 07:54 AM, Adhanedhel wrote:
Norm = norm((G(x+epsi*dx,z)-G(x-epsi*dx,z))/(2*epsi) -
At the end of this line, dG and dx are both vectors so "*" gives an error.
Perhaps you mean "norm(dG(...))*norm(dx)"? Or an inner product like
"(dG')*dx", or "dot(dG, dx)", or ... etc
To me, it looks like you are trying to compare the finite difference to
the directional derivative. One approach:
dirderiv = ... % exercise for reader
finitediff = G(x+epsi*dx,z)-G(x-epsi*dx,z))/(2*epsi);
Norm = norm(finitediff) - norm(dirderiv)