This functions returns the derivative of the curve whose XY coordinates denoted by vector vx and vy. No smoothing is performed in this function. Derivative is computed by taking the average slopes from the previous and next two data points except at the ends where only one slope is used. This algorithm is applied recursively for each order n.
vector DerivativeXY(vector vx, vector vy[, int n])
vx
vy
n
Return the nth order of derivatives of specified curve (vx, vy).
The following example calculates the first derivative from sample data HiddenPeaks.dat and creates a stacked line plot.
newbook; string fn$ = system.path.program$ + "Samples\Spectroscopy\HiddenPeaks.dat"; impasc fname:=fn$; col(3)=DerivativeXY(col(1),col(2),1); col(3)[L]$ = "1st Deriv"; plotstack iy:=(1,2:3) plottype:=line link:=1 xlink:=1; range l1 = 1!; l1.x.from = 0; l1.x.to = 10;