diff
y = diff ( x,n[=1] ) y = x.diff ( n[=1] )

Calculates the nth difference between adjacent elements of x
arg

type

Description

Unit or Value scale

x

VCT or AUDIO

the array or signal


n

SCAL

skip count


Outputs

 y is the array of nth order difference.

Notes

 If x is a matrix, y is a matrix of rowwise operations

Examples

 a=1:5; a.diff → [1 1 1 1]
 a.diff(2) → [2 2 2]
 s=(1:12).matrix(3); s(2,:) *= 10; ss.diff →
ans = 1 1 1 10 10 10 1 1 1

cumsum
Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents