1
$\begingroup$

I have to vectors

X={1,0,0};
Y={0,0,1};

and I would like to find the easiest way to construct the matrix 3x2 whose first column is X and second column is Y.

$\endgroup$

closed as off-topic by J. M. is away Oct 26 '17 at 13:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – J. M. is away
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Transpose[Join[{X}, {Y}]]? $\endgroup$ – Kiro Oct 19 '17 at 9:12
  • $\begingroup$ Perfect, thank you $\endgroup$ – Smilia Oct 19 '17 at 9:14
  • 4
    $\begingroup$ ...also Transpose[{X, Y}] and Thread[{X, Y}] $\endgroup$ – kglr Oct 19 '17 at 9:17
4
$\begingroup$

There are many ways, but "the right way" is

Transpose[{X,Y}]

It is compact and does not unpack.

$\endgroup$

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