I have these two lists:(adsbygoogle = window.adsbygoogle || []).push({});

L1 = {a, b, c}

L2 = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}

Now, my goal is to match up the first element of L1, which is a, to all the first elements of L2 and the second element of L1 (b) with all the second elements of L2 and the same with c. So I would get this:

L3 ={{a, 1}, {b, 2}, {c, 3}},{{a, 4}, {b, 5}, {c, 6}},{{a, 7}, {b, 8}, {c, 9}}

So L3 would consist of three seperate lists. I can do this by using the command:

Table[Table[{L1[], L2[[k]][]}, {i, 1, 3}], {k, 1, 3}]

However, this takes up a lot of memory and almost freezes my computer. There must be a better way to do it?

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Simple problem in Mathematica involving lists

Loading...

Similar Threads for Simple problem Mathematica |
---|

Mathematica Storing Mathematica output |

Mathematica Mathematica to MATLAB |

LaTeX \vec command |

MATLAB Does anyone had this plotting problem with MATLAB? |

Mathematica Solve Perturbation problem with mathematica |

**Physics Forums | Science Articles, Homework Help, Discussion**