div.m

来自「matlab 多参数积分工具箱 multivariable calculus」· M 代码 · 共 28 行

M
28
字号
function D=div(V,name)%DIV  Divergence of a vector field.%   D = DIV(V[,NAME]) returns the divergence of a vector field V%   where V has the type vector and D has the type scalar.%%   See also GRAD, CURL, LAPL.% Copyright (c) 2001-04-13, B. Rasmus Anthin.% Revision 2002-12-06error(nargchk(1,2,nargin))[h1 h2 h3]=coeffs(V);D=1/(h1*h2*h3)*(...   pdiff(h2*h3*vec2sca(V,1),1)+...   pdiff(h1*h3*vec2sca(V,2),2)+...   pdiff(h1*h2*vec2sca(V,3),3));if nargin==1   name=inputname(1);endif isempty(name)   name=['(' V.fx ',' V.fy ',' V.fz ')'];endD=struct(D);D.f=['del' char(183) '(' name ')'];D=scalar(D);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?