# Is there a name for this matrix operation?

Transforming a matrix by copying each element up to a certain given length ($$k$$) and then starting on the next row with the second element, and row after that with the third, etc. So each row is shifted by one more. For example:

$$\begin{bmatrix}1\\2\\3\\4\\5\end{bmatrix} \rightarrow \begin{bmatrix}1 & 2 & 3\\2 & 3 & 4\\3 & 4 & 5\end{bmatrix}$$

With a parameter $$k=3$$ or

$$\begin{bmatrix}1\\2\\3\\4\\5\end{bmatrix} \rightarrow \begin{bmatrix}1 & 2 & 3 & 4\\2 & 3 & 4 & 5\end{bmatrix}$$

With a parameter $$k=4$$.

• If such operation is useful, it certainly has a name. And conversely.
– user65203
Dec 1, 2018 at 21:05
• Thinking to a fixed length window (length = 3 or 2 in your example) : you are sliding this window on the message "1 2 3 4 5" and you gather the results in a new matrix : thus it has something common with discrete convolution but I don't see any "closed form" matrix expression that can render this operation... Dec 1, 2018 at 22:15
• I would call the 1st operation Hankelization. Dec 2, 2018 at 8:01

The operation looks a little too particular to me to have a (well known) name.

The resulting matrix is like a Toeplitz matrix (except that it's constant along the anti-diagonals), could be regarded as some sort of "toeplitzation" (ugh)...

For example, the second example in Matlab/Octave:

>> fliplr(toeplitz([4,5],[4,3,2,1]))
ans =

1   2   3   4
2   3   4   5

• Thanks! This opened up some good things for me to look into. From Toeplitz I found Hankel which seems like I can use to do at least something close to what I need. Dec 1, 2018 at 21:43
• If you are looking for ways to do this in Python, you may also be interested in vstack. Dec 2, 2018 at 7:56