For Loop for an m-by-1 matrix
Hello guys, I can not figure out how to make a for loop for a m-by-1 matrix (hence a 1 column vector) with which I start at the second element and subtract the previous element and then repeat this operation on the following elements.
How can I do this ?
for example I have an excel column called "Ref" that is made by these numbers:
Ref
839825
851892
851955
851969
851964
851518
851953
850544
I need something that in matlab will do for me :
851892-839825 =
851955-851892 =
ecc...
and create another column called :
Ref(j) - Ref(j-1)wih under it all the calcutated subtractions
Any help please ?
Thnak you