1. PF Contest - Win "Conquering the Physics GRE" book! Click Here to Enter
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simple table in Mathematica

  1. May 1, 2009 #1
    1. The problem statement, all variables and given/known data

    I have two lists, say {a, b, c} and {1, 2, 3}. I want to place them in a table such as this

    a 1
    b 2
    c 3

    So a will correspond to 1, b to 2, etc.

    3. The attempt at a solution

    I know that TableForm[{{a, 1}, {b, 2}, {c, 3}}] would give the result I need. So I need to find a way to 'connect' the elements my two lists somewhow, if that makes sense. How do I go about this?
    Last edited: May 1, 2009
  2. jcsd
  3. Dec 3, 2010 #2
    Try this out:

    Join[Transpose[{{a, b, c}}], Transpose[{{x, y, z}}], 2]

    you need to write your list as {{a,b,c}} instead of {a,b,c}. the first one is a matrix and the second one is a vector; in mathematica they are not just the same; and you can't apply Transpose[] to a mathematica's vector (you can by writing Transpose[{a,b,c},{1}], but that does not give the desired result). You needed to find a way to 'join' the two :-p

    (please, try to answer a question I made about making tables if you can, look at my profile, thanks)
    Last edited: Dec 3, 2010
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Simple table Mathematica Date
Simple MOSFET Driver Circuit Tuesday at 2:02 AM
Simple Equivalence Problem- help please (First Year Statics) Feb 16, 2018
Setting up a truth table Jan 15, 2018
Simple gear train, typo? Dec 18, 2017