I have one column matrix with n rows. I want difference between row 2 and row 1, then row 3 from row 2, and so on. I should have a new matrix with n-1 rows. I am using Matlab.
513083
513386
513662
513939
514213
514471
514727
514979
515225
I tried this: for x = 1:(numel(maxtab(:,1))-1) difference = maxtab(x+1,1) - maxtab(x,1); end but I don’t get the matrix. I want to avoid for loops because they slow down the process. Any suggestions. Im trying to do away with Excel because of its limitations on rows.
Use
diff().