Suppose I have some real-valued vector $v$ with dimension $K$. How can I convert $v$ to some matrix $M$ such that each row of $M$ is an instance of $v$? Is there a way to do this mathematically?
Asked
Active
Viewed 68 times
1 Answers
3
If $v$ is a row vector and $\textbf{1}_K$ the $K$-dimensional vector of ones, then $\textbf{1}_K v^T$ is a matrix with $v$ in each row, where the superscript $T$ is transpose. Is that what you were looking for?
Fede Poncio
- 459
-
1@David Mitra. Make the difference between $v^T\mathbf{1}$, matrix $1 \times 1$ identified to a scalar, and $\mathbf{1}v^T$, matrix $n \times n$. – Christophe Leuridan Apr 28 '22 at 20:47
-
@ChristopheLeuridan Thanks; I misinterpreted what "row vector" meant. – David Mitra Apr 28 '22 at 21:43
-
perfect man. that was exactly what i wanted – Stan Shunpike Apr 28 '22 at 23:34