Y = diff(X) calculates differences between adjacent elements of X.
Y = diff(X,n) applies diff recursively n times, resulting in the nth difference. Thus, diff(X,2) is the same as diff(diff(X)).
Y = diff(X) calculates differences between adjacent elements of X.
Y = diff(X,n) applies diff recursively n times, resulting in the nth difference. Thus, diff(X,2) is the same as diff(diff(X)).