MATLAB: Multiply the element of a matrix with the element after it.

matrix manipulation

example [2 3 4 5] i want [2*3 3*4 4*5]

Best Answer

a=[2 3 4 5];
i=1:numel(a)-1;
b=a(i).*a(i+1)