The function Diff calculates the finite differences of all columns or all rows (depending on the parameter Mode). The order of the differences is controlled by the parameter Order.
Please note that the algorithm removes all rows/columns which do not contain valid results. Thus, in order to align the finite differences with the original data series, the resulting matrix data have to be shifted by (Order div 2):
The function Diff returns the following error codes:
0 ... everything is OK
1 ... invalid order (valid range: 1..10)
2 ... too few columns/rows
