# divergence

Version:

Computes the divergence of a 2D or 3D vector field.

## Syntax

d = divergence(Fx, Fy)
d = divergence(Fx, Fy, Fz)
d = divergence(dx, dy, Fx, Fy)
d = divergence(dx, dy, dz, Fx, Fy, Fz)

## dx

Spacing between points along the x-axis or between values of the second dimension in a 2D or 3D array. dx is an array.

## dy

Spacing between points along the y-axis or between values of the first dimension in a 2D or 3D array. dy is an array.

## dz

Spacing between points along the z-axis or between values of the third dimension in a 3D array.

## Fx

X-components of a two-dimensional vector field. Fx is a 2D or 3D array.

## Fy

Y-components of a two-dimensional vector field. Fy is a 2D or 3D array. size(Fy) must equal size(Fx).

## Fz

Z-components of a three-dimensional vector field. Fz is a 3D array.

## d

Divergence of the vector field. d is of the same dimensions and data type as Fx.

## Specifying the Spacing between the Points of the Divergence

dx, dy, and dz are arrays, and their values of the elements specify the coordinates of the points in the corresponding axis. If dx, dy, or dz contains only one element, MathScript returns an error.

FX = rand(3, 4);
FY = rand(3, 4);
D = divergence(1:4, 1:3, FX, FY)

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices