MATLAB: Element to element sum

sum

hi
i have X = [1 5 7 6 9 2 3 1 4 8 6 5]; and i want to do [1+5 5+7 7+6 6+9 …] how can i do that?
thanks

Best Answer

X(1:end-1)+X(2:end)