Next: dilate, Previous: diagnostic, Up: Internal Routines [Contents][Index]

`differ(`

`x` [, `axis`, `order`] [, /central])

Returns the running difference of

: each element of the
result contains the difference between the corresponding element of
`x`

and its |`x`

|-th predecessor. The
predecessors of the first elements are taken to be zero. If
`order`

is not specified (or negative), then `axis`

is
treated as a 1d array. Otherwise, differencing is done along the
indicated axis (dimension), and is started over for each of the other
dimensions. If `x`

is positive, then the unavailable
(first) values of each result vector are set to zero; if negative, then
the value from the original is copied (i.e. reverse of `order``runsum`

).
The default

is 1. The `order``/central`

keyword
indicates that central differencing is performed, i.e. the differences
are put in the middle of the range instead of at the end. For central
differencing, the border values are always set to zero.

Both

and `axis`

may contain multiple
elements, in which case a differencing pass is performed for each of the
elements, taken the next available element from both. If
`order`

has only one element but `order`

has more
than one, then the same value of `axis`

is used during each
pass. Otherwise, both arguments must contain zero, one, or equal
numbers of elements.
`order`

Reverse: runsum