Check your dimensaion. Your cumsum will be a 1xn vector. I suspect time must be an nx1. When you perform the division, implicit expansion will turn this into an nxn. The fix would be to transpose time.
% (1xn)./(1xn) = (1xn)
a = cumsum(1:4)./ones(1,4)
% (1xn)./(nx1) = (nxn)
b = cumsum(1:4)./ones(4,1)