Check out example codes for "diff(x) matrix matlab". It will help you in understanding the concepts better.

Code Example 1

X = [1 3 5;7 11 13;17 19 23];
Y = diff(X,1,2)
Y = 3×2


ans:
     2     2
     4     2
     2     4

Learn ReactJs, React Native from akashmittal.com