MATLAB: How to combine these answers into a matrix

for loopsMATLABmatrix

Here is the code I have.
A=[1;13;15;20;23;27];
for k=2:6;
[index_diff]=A(k,1)-A(k-1,1)
end
I would like to put the answers (12,2,5,3,4) into a 5 by 1 matrix. How do I do this?

Best Answer

diff(A)
will do this.