How to express a matrix where each row consists of replicas of element of a vector $x$

57 Views Asked by At

Let $x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix}$

How do I find a way to express the following matrix

\begin{bmatrix} x_1 & x_1 & \ldots & x_1 \\ x_2 & x_2 & \ldots & x_2 \\ \vdots \\ x_n & x_n & \ldots & x_n\end{bmatrix}

into say a product between a matrix and vector $x$ (or an outer product, or hadamard product...etc)

2

There are 2 best solutions below

2
On BEST ANSWER

$$\begin{bmatrix}x_1 \\ x_2 \\ \vdots \\ x_n\end{bmatrix} \begin{bmatrix}1 & 1 & \cdots & 1\end{bmatrix}$$

0
On

Your vector is an $n \times 1$ matrix, and the resultant matrix you want is $n \times n$. So, you would need a $1 \times n$ matrix.

Try $[1\quad 1 \quad \cdots \quad1]$