0
$\begingroup$

I have the following problem: let consider a vector $a=(a_1, ..., a_N)^T$. I would like to construct a 'sliding matrix' A so that:

$A=\begin{pmatrix} a_1 & ... & a_1 & 0 & & & ... & & & 0 \\ 0 & ... & 0 & a_2 & ... & a_2 & 0 & ... & & 0 \\ 0 & & & ... & & 0 & \ddots & & & \\ 0 & & & & ... & & 0 & a_N & ... & a_N \end{pmatrix}\in K^{N\times NM}$

Each element of $a$ is repeated $M$ times in $A$, which has a size $N\times NM$. For the moment, I only found the means to obtain a unitary $M$, using a kronecker product $I_N \otimes 1_M$...

Thank you!

$\endgroup$
1
$\begingroup$

I'm not sure what exactly you're saying about your usage of the Kronecker product. In any case, your matrix can be written in the form $D \otimes \mathbf 1^T$, where $$ D = \operatorname{diag}(a) = \pmatrix{a_1 \\ & \ddots \\ && a_n}, \quad \mathbf 1 = (1,\dots,1)^T. $$

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Starting with $$I_N \otimes \vec{1}_M^T = \begin{pmatrix} 1 & ... & 1 & 0 & & & ... & & & 0 \\ 0 & ... & 0 & 1 & ... & 1 & 0 & ... & & 0 \\ 0 & & & ... & & 0 & \ddots & & & \\ 0 & & & & ... & & 0 & 1 & ... & 1 \end{pmatrix},$$ we simply need to multiply the first row by $a_1$, the second row by $a_2$, ..., and the $N$-th row by $a_N$. This can be done with a diagonal matrix multiplication on the left, i.e. $$\text{diag}(a)(I_N \otimes \vec{1}_M^T) = \begin{pmatrix} a_1 & ... & a_1 & 0 & & & ... & & & 0 \\ 0 & ... & 0 & a_2 & ... & a_2 & 0 & ... & & 0 \\ 0 & & & ... & & 0 & \ddots & & & \\ 0 & & & & ... & & 0 & a_N & ... & a_N \end{pmatrix}$$ where of course $\text{diag}(a) = \begin{pmatrix}a_1 & & & \\ & a_2 & & \\ & & \ddots & \\ & & & a_N \end{pmatrix}$.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ so obvious that I didn't even see it.... Thanks!! $\endgroup$ – Quentin Sep 23 at 20:39
  • $\begingroup$ Actually, use Ben Grossmann's answer since it is simpler. $\endgroup$ – JimmyK4542 Sep 23 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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