How to make the matrix in this image

How to make the matrix in this image? I need to achieve it with LaTeX.

• Welcome to TeX.SE! Please provide us with an minimal working example (MWE) to show us, what you've tried so far. A good overview of mathematics in LaTeX can be found here. – Hackbard_C Aug 17 '14 at 18:34
• Thank you. But I found nothing. – Said Aug 17 '14 at 18:43
• Please search again. – Hackbard_C Aug 17 '14 at 18:49
• See the suggested links on the right side of this page. – pluton Aug 17 '14 at 18:50
• @Hackbard_C They are not fit for the matrix given in the image. – percusse Aug 17 '14 at 19:21

You can use blkarray:

\documentclass{article}
\usepackage{amsmath,blkarray,mathrsfs}
\DeclareMathOperator{\Mat}{Mat}

\begin{document}
$\Mat_{\mathscr{B},\mathscr{C}}(f)= \Mat_{\mathscr{C}}(f(\mathscr{B}))= \begin{blockarray}{ccccccl} f(e_1) & f(e_2) & & f(e_j) & & f(e_n) \\ \downarrow & \downarrow & & \downarrow & & \downarrow \\ \cline{4-4} \begin{block}{(ccc|c|cc)l} a_{11} & a_{12} & \dots & a_{1j} & \dots & a_{1n} & \leftarrow f_1 \\ a_{21} & a_{22} & \dots & a_{2j} & \dots & a_{2n} & \leftarrow f_2 \\ \vdots & \vdots & & \vdots & & \vdots \\ a_{i1} & a_{i2} & \dots & a_{ij} & \dots & a_{in} & \leftarrow f_i \\ \vdots & \vdots & & \vdots & & \vdots \\ a_{n1} & a_{n2} & \dots & a_{nj} & \dots & a_{nn} & \leftarrow f_n \\ \end{block} \cline{4-4} & & & \uparrow \\ \end{blockarray}$
\end{document}


Or with tikz

\documentclass{article}
\usepackage{amsmath,mathrsfs}
\usepackage{tikz}
\usetikzlibrary{matrix,positioning,fit}
\DeclareMathOperator{\Mat}{Mat}
\begin{document}
\begin{equation*}
\Mat_{\mathscr{B},\mathscr{C}}(f)=\Mat_{\mathscr{C}}\bigl(f(\mathscr{B})\bigr)=
\begin{tikzpicture} [baseline=(m.center),every left delimiter/.style={xshift=2ex},
every right delimiter/.style={xshift=-2ex}] %,
column 6/.style={anchor=base east}]
\matrix (m)[matrix of math nodes,left delimiter=(,right delimiter=)]
{
a_{11} &[3mm] a_{12} & \dots & a_{1j} & \dots & a_{1n} \\
a_{21} & a_{22}      & \dots & a_{2j} & \dots & a_{2n} \\[-2mm]
\vdots & \vdots      &       & \vdots &       & \vdots \\
a_{i1} & a_{i2}      & \dots & a_{ij} & \dots & a_{in} \\[-2mm]
\vdots & \vdots      &       & \vdots &       & \vdots \\
a_{n1} & a_{n2}      & \dots & a_{nj} & \dots & a_{nn} \\
};
\begin{scope}[every node/.style={text=blue}]
\foreach \j/\sub in {1/1,2/2,4/i,6/n} \node[right=\tabcolsep of m-\j-6.east] {$\leftarrow f_{\sub}$};
\foreach \i/\sub in {1/1,2/2,4/j,6/n} \node[above=1.2\tabcolsep of m-1-\i.north] (a-\i) {$f(e_{\sub})$};
\foreach \i in {1,2,4,6} \draw[blue,->] (a-\i) -- (m-1-\i);
\end{scope}
\node[line width=1pt,draw=blue,inner sep=-1pt,fit=(m-1-4) (m-6-4)](mfit){};
\draw[blue,->] ([shift={(-5mm,-5mm)}]mfit.south) -| ([yshift=-1mm]mfit.south);
\end{tikzpicture}
\end{equation*}
\end{document}