Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want just data without comma and brackets. Even TableForm is not working for me. For example, the general pattern of my table is

t = Table[Table[{m, n}, {m, 1, 10}], {n, 1, 9}]

which gives output in the for {x1,y1},{x2,y2}..... . If I use TableForm it will show output as:

1 2 3  ... 10
1........... 
...............
2...Numbers......
..............
9............9

But I want output of just two columns for the values of m and n ({m,n}) like

m1 m2
m3 m4
.....

How to do that? Or suggest me how convert the data in the form {{x1,y1},{x2,y2}} in just two columns?

share|improve this question
    
You've seen Grid[]? –  J. M. Jul 23 '12 at 12:04
    
Apart from the fine answers you've already gotten: Flatten[Outer[Composition[Reverse, List], Range[5], Range[6]], 1] // Grid –  J. M. Jul 23 '12 at 12:35
    
Thank you ! @J.M. –  Mush Jul 23 '12 at 17:45
    
My answer was intended to be complementary to acl's. The actual method in both answers is to use Grid after merging the top level of the array (with either Faltten or Join), and he posted first. I am glad that you liked my answer but I would prefer that you accept his. This is by no means required and you are always at liberty to Accept whatever answer you choose; it is simply my request. –  Mr.Wizard Jul 24 '12 at 8:32

2 Answers 2

up vote 3 down vote accepted
Join @@ Array[{#2, #} &, {5, 6}] // Grid

Tuples@Range@{5, 6} ~Reverse~ {2} // Grid
share|improve this answer
    
Or Join @@ Transpose[Array[List, {6, 5}]] // Grid –  J. M. Jul 23 '12 at 12:29
t = Table[Table[{m, n}, {m, 1, 6}], {n, 1, 5}];
Flatten[t, 1] // Grid

Mathematica graphics

share|improve this answer
1  
Some compaction can be done: t = Table[{m, n}, {n, 1, 5}, {m, 1, 6}];. –  J. M. Jul 23 '12 at 12:09
    
@J.M. & acl You both beat me by a few seconds - with the answer and the comment ;-) –  Vitaliy Kaurov Jul 23 '12 at 12:12
    
Thanks a lot !! –  Mush Jul 23 '12 at 17:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.