Guest User

Untitled

a guest
Jan 13th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. list = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.994429, 0.980929, 0.971825,
  2. 0.967241, 0.967241, 0.971825, 0.980929, 0.994429, 0, 0, 0, 0, 0, 0,
  3. 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0.998888, 0.971825,
  4. 0.948683, 0.929755, 0.915302, 0.905539, 0.900617, 0.900617,
  5. 0.905539, 0.915302, 0.929755, 0.948683, 0.971825, 0.998888, 0, 0, 0,
  6. 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0.971825, 0.939267, 0.910433,
  7. 0.885689, 0.865384, 0.849837, 0.839312, 0.834, 0.834, 0.839312,
  8. 0.849837, 0.865384, 0.885689, 0.910433, 0.939267, 0.971825, 0, 0, 0,
  9. 0, 0, 0, 0}}
  10.  
  11. list = Partition[Flatten[list], 3]
  12.  
  13. Total[Partition[list, {3, 3}], {3, 4}]
  14.  
  15. {{0, 0, 2.90998, 6.506198, 8.164602, 8.164602, 6.506198, 2.90998, 0, 0}}
  16.  
  17. array = Transpose /@ ArrayReshape[Transpose@list, {10, 3, 3}];
  18. MatrixForm /@ array
  19.  
  20. Total /@ Flatten /@ array
  21.  
  22. Total /@ Flatten /@ ArrayReshape[Transpose@list, {10, 3, 3}]
  23.  
  24. BlockMap[Total[#, 2]&, list, {3, 3}]
  25.  
  26. Partition[list, {3, 3}, {3, 3}, None, {}, Plus]
Add Comment
Please, Sign In to add comment