The DERIV function performs numerical differentiation using 3-point, Lagrangian interpolation and returns the derivative.
Result = DERIV( [X,] Y )
The variable to differentiate with respect to. If omitted, unit spacing for Y (i.e., X i = i ) is assumed.
The variable to be differentiated.
X = [ 0.1, 0.3, 0.4, 0.7, 0.9]
Y = [ 1.2, 2.3, 3.2, 4.4, 6.6]
PRINT, DERIV(Y)
IDL prints:
1.20000 1.00000 1.05000 1.70000 2.70000
PRINT, DERIV(X,Y)
8.00000 6.66667 5.25000 6.80000 10.800
DERIVSIG