3.5.1.1.5 Derivative

Description

This functions returns the derivative of the data list in a given vector. No smoothing is performed in this function. Derivative is computed by taking the average of the two data points slopes from the previous and next data points except at the ends where only one slope is used. This algorithm is applied recursively for each order n.

Syntax

vector Derivative(vector vx[, int n])

Parameters

vx

The data vector used to calculate derivative.

n

The order of derivative. Default value is 1.

Return

Return the nth order of derivatives vector.

Example

for(ii=1;ii<=32;ii++) col(1)[ii]=sin(pi*(ii*30)/180);
col(2)=Derivative(col(1),1);
col(3)=derivative(col(1),2);
plotxy iy:=(<autoX>,1:3) plot:=200;