0

I was wondering if there is an automatic way to do this kind of matrix operation.

For example, for a given matrix

list = {{1, 3T}, {3, 8T}, {2, 2T}, {1, 5T}, {4, 6T}};  

I want the result to be like this as shown below after the operation.

result = {{1 ,8T}, {2, 2T}, {3, 8T}, {4, 6T}}

The operation will add the terms in the second column if they have the same number in the first column for all the rows. i.e. for the first row, the second term is calculated as 3T plus 5T,which is the term in list[[4,2]].

Öskå
  • 8,587
  • 4
  • 30
  • 49
user11726
  • 105
  • 4

0 Answers0