Documentation

Compute the gradient of a matrix. More...

## Modules

The C interface for Gradient along a dimension.

## Detailed Description

Compute the gradient of a matrix.

grad computes the gradient of a matrix using a central difference along a given dimension. For an interior point in the matrix, $$n_i$$, the central difference is computed as $$\frac{n_{i+1} - n_{i-1}}{2}$$. For exterior points (those along the edge of the matrix), a one-sided difference is used.

array a; //a = [4 5 3]
// [8 10 9]
// [9 15 20]
array dx,dy;