Calculates difference between successive data points.
Replaces an array with the difference between successive points. This is the "delta" in difference equations. In order to maintain the same qty of values, the first data point is kept.
menu: veeos ==> Math ==> dif
library: mathLib
o_dif([1 4 3 6 7 8]) returns [1 3 -1 3 1 1]
When creating difference equations, say dif(a) / (dif(a) +1) one of course needs a dif function, just as one needs an integral function for differential equations. This rendition of dif fits that bill. Note that dif should actually return one less point than the input, but in order to make successive operations easy the input array length is maintained by arbitrarily keeping the first data point in place. This will of course cause end effects.
VEE 7.0+, all platforms