Spline Toolbox™ Previous page   Next Page 
fndir
 Provide feedback about this page

Directional derivative of function

Syntax

Description

df = fndir(f,y) is the ppform of the directional derivative, of the function in f, in the direction of the (column-)vector y. This means that df describes the function .

If y is a matrix, with n columns, and is d-valued, then the function in df is prod(d)*n-valued. Its value at , reshaped to be of size [d,n], has in its th `column' the directional derivative of at in the direction of the th column of y. If you prefer df to reflect explicitly the actual size of , use instead

Since fndir relies on the ppform of the function in f, it does not work for rational functions nor for functions in stform.

Examples

For example, if f describes an m-variate d-vector-valued function and x is some point in its domain, then, e.g., with this particular ppform f that describes a scalar-valued bilinear polynomial,

is the Jacobian of that function at that point (which, for this particular scalar-valued function, is its gradient, and it is zero at the origin).

As a related example, the next statements plot the gradients of (a good approximation to) the Franke function at a regular mesh:

Here is the resulting plot.

Algorithm

The function in f is converted to ppform, and the directional derivative of its polynomial pieces is computed formally and in one vector operation, and put together again to form the ppform of the directional derivative of the function in f.

See Also

fnchg, fnder, fnint, franke


 Provide feedback about this page 

Previous page fnder fnint Next page

 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS