Function Reference
— Function File: d = del2 (m)
— Function File: d = del2 (m, h)
— Function File: d = del2 (m, dx, dy, ...)

Calculates the discrete Laplace operator. If m is a matrix this is defined as

                1    / d^2            d^2         \
          D  = --- * | ---  M(x,y) +  ---  M(x,y) |
                4    \ dx^2           dy^2        /

The above to continued to N-dimensional arrays calculating the second derivative over the higher dimensions.

The spacing between evaluation points may be defined by h, which is a scalar defining the spacing in all dimensions. Or alternative, the spacing in each dimension may be defined separately by dx, dy, etc. Scalar spacing values give equidistant spacing, whereas vector spacing values can be used to specify variable spacing. The length of the vectors must match the respective dimension of m. The default spacing value is 1.

You need at least 3 data points for each dimension. Boundary points are calculated as the linear extrapolation of the interior points.

See also: gradient diff