Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

Answer:

(*Generate table*)
table = Table[RandomReal[], {6}, {3}];

(*Declare positions*)
pos = {2, 3, 5};

(*Carry out addition, removal and modification*)
Append[Delete[table, Partition[pos, 1]], #] &[Total@# &[table[[#]] & /@ pos]]

Reference:
Append
Table
RandomReal
Delete
Partition
Total
@ | /@ | # etc.@ | /@ | # etc.

Answer:

(*Generate table*)
table = Table[RandomReal[], {6}, {3}];

(*Declare positions*)
pos = {2, 3, 5};

(*Carry out addition, removal and modification*)
Append[Delete[table, Partition[pos, 1]], #] &[Total@# &[table[[#]] & /@ pos]]

Reference:
Append
Table
RandomReal
Delete
Partition
Total
@ | /@ | # etc.

Answer:

(*Generate table*)
table = Table[RandomReal[], {6}, {3}];

(*Declare positions*)
pos = {2, 3, 5};

(*Carry out addition, removal and modification*)
Append[Delete[table, Partition[pos, 1]], #] &[Total@# &[table[[#]] & /@ pos]]

Reference:
Append
Table
RandomReal
Delete
Partition
Total
@ | /@ | # etc.

Source Link
e.doroskevic
  • 6k
  • 1
  • 14
  • 32

Answer:

(*Generate table*)
table = Table[RandomReal[], {6}, {3}];

(*Declare positions*)
pos = {2, 3, 5};

(*Carry out addition, removal and modification*)
Append[Delete[table, Partition[pos, 1]], #] &[Total@# &[table[[#]] & /@ pos]]

Reference:
Append
Table
RandomReal
Delete
Partition
Total
@ | /@ | # etc.