New Reply

Mathematica - turning two lists into an array

 
Share Thread Thread Tools
Mar9-09, 08:07 AM   #1
 

Mathematica - turning two lists into an array


Hi

I need to turn two lists in the form {a1,a2,a3...} {b1,b2,b3...}
into {{a1,b1},{a2,b2},{a3,b3}..}

I've looked everywhere on the Wolfram website and the best i found was:

Riffle[{list1},{list2}] which gives me {a1,b1,a2,b2,a3,b3}

does anyone know the function to use?

Thanks
 
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Hong Kong launches first electric taxis
>> Morocco to harness the wind in energy hunt
>> Galaxy's Ring of Fire
Mar27-11, 04:50 PM   #2
 
Hi,
Maybe this:
Transpose[{{a1, a2, a3}, {b1, b2, b3}}]
 
Mar27-11, 07:39 PM   #3
 
Recognitions:
Gold Membership Gold Member
Homework Helper Homework Help
Science Advisor Science Advisor
Equivalently, {{a1, a2, a3}, {b1, b2, b3}}TR. (The transpose symbol comes from hitting Esc, tr, Esc.)
 
New Reply
Thread Tools


Similar Threads for: Mathematica - turning two lists into an array
Thread Forum Replies
Inputting an array in to a function or returning an array? (C++) Programming & Comp Sci 5
converting from an array of function values to coordinate array of different length Programming & Comp Sci 3
Skipping numbers in lists in Mathematica Math & Science Software 2