MATLAB: How to add values from vector

vectors

Hello all,
Suppose I have a vector and I want to add every five sequential values together. So for example if v1=[1 1 1 1 1 1 1 1 1 1]; Then I'm expecting to get v2 as: v2=[5 5]; How to implement this in matlab?
I tried the following code:
%%%%%%%
v=[1 1 1 1 1 1 1 1 1 1];
for i=1:i+5:length(v)
v2(i)=v(i)+v(i+1)+v(i+2)+v(i+3)+v(i+4)
end
%%%%%%%
But the answer was wrong; it was
v2=[5 0 0 0 0 5]

Best Answer

A Matlabish way
>> sum( reshape( ones(1,10), 5, [] ) )
ans =
5 5
it assumes that the length of v1 is a multiple of 5