dif(a)

Calculates difference between successive data points.


Syntax

o_dif(a)
a: array numeric - array of data values
return: array numeric -  difference between successive data points

Usage

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.

Location

menu: veeos ==> Math ==> dif

library: mathLib

Example

o_dif([1 4 3 6 7 8]) returns [1 3  -1 3 1 1]

Notes

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.

Reference

Dependencies

Supported On

VEE 7.0+, all platforms

See Also


© 2015. All Rights Reserved.  Stan Bischof (stan@worldbadminton.com). Last updated 04 November 2015 11:30. © 2015.