I am trying to resolve why the following Matlab syntax does not work.
Actually what you are doing is s(1:10)= sum(A(1:[1,2,3...10])) what you should do is
for i=1:10 s(i)=sum(A(1:i)) end
hope it will help you