Question: Adding matrix elements

My problem is the following:

I need to add the elements of a matrix (300 by 2) of real numbers  in such way that i will get a new list of elements each one of which will be defined as the sum of all the previous elements plus itself (i mean the elements found in the first matrix).

To make it more clear i want with that way to get results for an intergration made by the trapezoid rule which is not applied to a function but to a list of values stored in a matrix. So i can calculate each trapezoid but i cannot obtain the total sum....

i have tried quite hard to apply the sum command to a matrix where all the elements had the value 2 but i couldnt get the right results which will be : 2, 4,6,8,10...etc

 

Can u help me either to apply the trapezoid rule to an n by 2 matrix either to advise me how can i use the sum command properly to get the right result?

 

Thanx in advance,

 

Thanos

University Erlangen-Nürnberg

Please Wait...