Scilab Function
Last update : 31/10/2005
grad - gradient of function F
Calling Sequence
-
[fx,fy] = grad(F,dx,dy)
Parameters
-
F
: matrix, representing a function F(x,y)
-
dx
: optional parameter, default is 1. dx can be a scalar, then it
represents the distance between equally spaced abscissa values. If
it is a vector, then it represents the abscissa values x
itself.
-
dy
: optional. If it is not used, then dx is the same as dx. dx
must be in that case a scalar (distance between equally spaced
abscissa value), otherwise an error is reported.
-
fx
: the derivative in x direction
-
fy
: the derivative in y direction
Description
-
grad works with 2-dimensional arrays. higher dimensions are not
supported.
Examples
x=cumsum(rand(1,30));
y=cumsum(rand(1,40));
[X,Y]=meshgrid(x,y);
Z=sin(0.1 .*X - 0.2 .*Y);
[fx,fy]=grad(Z,x,y);
See Also
meshgrid
,
Authors
-
Dr. Andreas Geissler geisslea@web.de