0

I have $W=[W_1 W_2 \dots W_n]$ where $W_n$ is a $n \times 1$ vector and $A=[a_1, \dots, a_n]'$ where $a_n$ are scalars and want to do the following:

$[a_1W_1, a_1W_2, \dots a_nW_n]$ to return a $(n \times n)$ matrix. Is there notation for this? Or some other way to do something equivalent?

LJB
  • 103
  • Kronecker product I think should also work http://en.wikipedia.org/wiki/Kronecker_product – user103828 Feb 05 '15 at 18:23
  • Kronecker product multiplies [a_1 W, ... a_n W], not the columns of W. I had already checked it. Robert's answer works. – LJB Feb 05 '15 at 20:36

1 Answers1

1

$W \text{diag}(A)$ where $\text{diag}(A)$ is the $n \times n$ diagonal matrix with diagonal elements $a_1, \ldots, a_n$.

Robert Israel
  • 448,999
  • @LBox: And if you wantto learn how you could have found that yourself, see my answer to: http://math.stackexchange.com/questions/198257/intuition-for-the-product-of-vector-and-matrices-xtax/198280#198280 – kjetil b halvorsen Feb 05 '15 at 18:19