0
$\begingroup$

There might be related posts but so far I'd not been able to find them:

u={u1,u2,u3}
v={v1,v2,v3}

where $u$ and $v$ are two column vectors. I want to use $u\times v^T$ to create a matrix, where $\times$ represent matrix multiplication, and $v^T$ represent the transpose of the $v$, which was a row vectors.

Is there any easy way to do that? I have tried Matrixform, array, .,$\times$/Cross[] functions, but so far non of them worked.

$\endgroup$
  • 10
    $\begingroup$ Outer[Times, u, v] $\endgroup$ – march Oct 7 '19 at 4:04
  • 3
    $\begingroup$ For long, numerical vectors, KroneckerProduct[u,v] is usually faster. $\endgroup$ – Henrik Schumacher Oct 7 '19 at 13:38
4
$\begingroup$

Use Outer[Times, u, v]. See Outer.

If you want to use the matrix multiplication notation, you need to turn these vectors (one-index tensors) into matrices (two-index tensors):

Transpose[{u}].{v}
$\endgroup$

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