I am interesting about drafting the following in LaTeX. I am not so much expert in this, i am going to attach the code to generate the vector and matrix, and after that I am going to attach my desired output.
Code:
\begin{align}
\begin{pmatrix}a_1\\a_2\\\vdots\\a_k\end{pmatrix}
\begin{pmatrix}\varepsilon_1&0&\ldots&0\\ 0&\varepsilon_2&\ldots&0\\0&0&\ldots&0\\0&0&\ldots&\varepsilon_N\\
\end{pmatrix}
\end{align}
Output:
So what I want is a circle on the first and last element of vector (a1,..,ak) and an arrow that goes from a1 to the rectangle of first row of matrix, the same for the last row. Sorry if the circle is made in that bad way, I have done it manually, of course is preferred a circle draft in a better way.





tikzmarklibrary is a very nice way to do it. And also, feel free to look at the Related menu on the right, where some helpful answers would be found. – SebGlav Sep 10 '21 at 11:16