How to place an arrow on top and to the right of a matrix

by AL B   Last Updated March 14, 2019 20:23 PM

I am trying to create a matrix like this enter image description here

but I want the left arrow to be on the right side of the image because I want to have the name of the matrix on the left side. Here is what I have:

\[
M =\begin{bmatrix} 
f(1,1) & f(1,2) & \dots \\
f(2,1) & f(2,2) & \dots  \\
\vdots & \vdots & \vdots 
\end{bmatrix}
\]

I am not sure how to proceed after that. Anyone has any suggestions?

Tags : matrices arrows


Answers 1


With tikzmark it is straightforward.

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\[
M =\hspace*{1.5cm}\tikzmarknode{mat}{\begin{bmatrix} 
f(1,1) & f(1,2) & \dots \\
f(2,1) & f(2,2) & \dots  \\
f(3,1) & f(3,2) & \dots  \\
\vdots & \vdots & \ddots \\
 & &  \\
\end{bmatrix}}
\begin{tikzpicture}[overlay,remember picture]
\draw[blue,thick,-latex] node[anchor=south west] (nn1) at (mat.north west)
{$n$ columns} (nn1.east) -- (nn1-|mat.north east) 
node[midway,above,black]{$i$ changes};
\draw[red,thick,-latex] node[anchor=north east,align=center] (nn2) at (mat.north west)
{$m$\\ rows} (nn2.south) -- (nn2.south|-mat.south west) 
node[midway,above,black,rotate=90]{$j$ changes};
\end{tikzpicture}
\]
\end{document}

enter image description here

marmot
marmot
March 14, 2019 20:19 PM

Related Questions


Matrices with Arrows

Updated May 07, 2018 11:23 AM


How can I visualize Matrix operations?

Updated March 21, 2017 08:23 AM

How to write equations with arrow and illustration

Updated April 25, 2018 15:23 PM

tikzpicture arrow from one plot to another

Updated January 21, 2018 13:23 PM