divergence of a vector field at a point
g=div(xyz)
vector of rectangular coordinates of evaluation point, xyz=[x y z]
divergence value at xyz
curl(xyz) computes the divergence value of a vector field at the point given by xyz. the vector field needs to be specified explicitly or use emtdiv function.
function f=fx(x) f=x(1)*x(2).^2+x(2).^2.*x(3); endfunction function f=fy(x) f=x(2)*x(3).^2+x(3).^2.*x(1); endfunction function f=fz(x) f=x(3)*x(1).^2+x(1).^2.*x(2); endfunction g=div([1 2 3]);