MATLAB: Where is the mistake on cumulative sum of 4 matrices

cumsumsum

Hi everbody, I have 4 matrices and to find cumulative sum of them, i use this code:
%aa includes 4 matrices (4 line, 101 columns for each line)
for i=1:1:4;
cum_sum=cumsum(aa(i,:))
end
MATLAB gives me one result with this code. How can i generate 4 result with using this code?
Thanks

Best Answer

My best guess, with the current information as I write this, is that you just need either
cum_sum = cumsum(aa)
or
cum_sum = cumsum(aa,2)
without using the for loop at all.