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$
  • 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.

| improve this answer | |
$\endgroup$

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