2.62 How to sum all numbers in a list (vector)?
Given a vector or list \(1,2,3,4,5,6,7,8,9,10\) how to find the sum of all its elements?
Mathematica
list=Range[10]
|
{1,2,3,4,5,6,7,8,9,10}
|
Total[list]
|
55 |
Matlab
lst=1:10
sum(lst)
|
55 |
Maple
lst:=[seq( i, i=1..10 )];
add(lst)
|
55 |