gradient of a scalar field at a point
g=grad(xyz)
vector of rectangular coordinates of evaluation point, xyz=[x y z]
gradient vector at xyz
grad(xyz) computes the gradient vector of a scalar field at the point given by xyz. the scalar field needs to be specified explicitly or use emtgrad function.
function f=fx(x) f=x(1)*x(2).^2+x(2).^2.*x(3); endfunction g=grad([1 2 3]);