MATLAB: Subtract numbers in the row

rowsubtract

I have a row of different numbers like x=[12; 15; 19; 29; 37; 58…] how can I better subtract one number from the other like 15-12, 19-15, 29-19….?

Best Answer

diff(x)