I am a beginner in Mathematica. My question is: I have huge amount of x,y and z co-ordinates in separate lists named XCORD,YCORD,ZCORD and I want to combine them in one list
Example:
If the x co-oridinates list is given by XCORD = {x1,x2,x3}
, the y co-ordinates list byYCORD = {y1,y2,y3}
and the z co-ordinates list by ZCORD = {z1,z2,z3}
, I would like to have a resulting list of co-ordinates that looks like this:
{{x1,y1,z1},{x2,y2,z2},{x3,y3,z3}}
You can do this with Transpose:
More information about working with lists can be found here, and more specific to your question, here.
Please note that it's better (though it's allowed) not to start any variable of your own with a uppercase letter. Using a lowercase start of your variable name means you'll never get into conflict with the thousands of built-in symbols that all start with an uppercase letter.
Alternate solution using the MapThread function:
For large lists, Transpose is an ordner of a magnitude faster, though: