Two lists to a list of points

OLDen shared this question 4 years ago
Answered

Hi

Normally I make a list of points from the spreadsheet.

But how can I make a list of points from two lists defined as l1={1,2,3,4} and l2={5,6,7,8}?

I want a result as l3={{1,5},{2,6},{3,6},{4,8}}, and the aim is do linear regression on the points.

And I want to do it by use of commands in the inputline.

Regards

Olav

Comments (5)

photo
1

You can create a sequence: Sequence(l1(n) l2(n), n, 1, 4)

This takes every n-th number from 1 to 4 of the lists l1 and l2 to form the coordinates.More generally you can use the length of l1 and l2 instead of the end number of course

chris

photo
3

Try

(l1,l2)

photo
1

Wow, that's efficient :-)

photo
1

Brilliant

photo
1

Thank you so much for that, very efficient and clean!

photo
© 2023 International GeoGebra Institute