I'm simply looking for the {}+{}
function for sublist elements of a list: (Parallel sums of elements)
c = {{1, 2, 3, 4}, {8, 7, 6, 5}};
Plus[c]
Mean[c]
desired={9, 9, 9, 9}
Where Mean
does directly what it's supposed to, unfortunately Plus
doesn't. I tried Take
and Part
but they both do not seem to work here . Additionally, my c
consists of a varying number of elements. I tried to work with Length[c]
and Range
.. ({}+{}
is no solution as list element number varies) thank you for help!!
Answer
Use either
Plus@@c
or
Total[c]
Comments
Post a Comment