0

I have a long list of coordinates defined in some 8D space. I need to extract the first three coordinates only. How ?

For example :

coords = {{0.1, 0.4, -0.2, 1.2, 3.2, 0.5, 0.8, 2.2}, ...};

I need to define the list of all first three components :

reducedCoords := {{0.1, 0.4, -0.2}, ...}

Please, notice that I'm working with Mathematica 7.

Cham
  • 4,093
  • 21
  • 36

1 Answers1

5

This is core functionality:

coords = Table[Range[5], {3}]

{{1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5}}

coords[[All, 1 ;; 3]]

{{1, 2, 3}, {1, 2, 3}, {1, 2, 3}}

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355