MATLAB: How can i subtract the elements in a coloumn

subtarct

hello
for example, I have : a=[380 0;381 1;382 2;383 3;383 4;383 5;384 6]
I want to go into first column and do this : (381-380), (382-381), (383-382),
how can i do this in a loop or other ways? Thanks for i=1:length(a) b=a(i,1) ????? end

Best Answer

Start reading the tutorials.
diff(a(:,1))