DIFF

Purpose:

Calculates the 2 point series difference.

Syntax:

DIFF(series)

series

-

A series. The input.

Returns:

A series or array.

Example:

W1: {1, -2, 2, -1};setdeltax(1/10)

W2: diff(w1)

W3: rderiv(w1, 1)

 

W2 == {-3, 4, -3}

W3 == {-30, -40, -30, 10}

 

W2 computes the 2 point difference. The DELTAX of the data is ignored. RDERIV performs a similar calculation but the result is divided by DELTAX.

Remarks:

DIFF computes the 2 point series difference defined as:

 

 

DIFF is similar to the 2 point right derivative as computed by RDERIV:

 

 

however for DIFF, the length of the result is 1 less than the input length and the result is independent of DELTAX.

See Also:

DERIV

DYDX

FDERIV

GRADIENT

INTEG

LDERIV

RDERIV