We have moved to @ Placement Papers Hub !! Visit our new website here for more..

Matlab Compute the Running Sum operation


Compute the Running Sum (Check with sum), where Running Sum for element j = the sum of the elements from 1 to j, inclusive

>> X=[1 2 3 4]

X =

     1     2     3     4

>> Sums=0;
>> for i=1:4
Sums=Sums+X(i)
end

Sums =

     1


Sums =

     3


Sums =

     6


Sums =
    10