# subscripted matrices operation

I need to manage how to work with several matrices in line, each one with its own left and right subscripts (like in the image). \prescript suited me for a single matrix, but didn't work with 2 matrices:

    $\prescript{}{n}{\begin{bmatrix} y_{11}\\ y_{12}\\ y_{13}\\ y_{14}\\ y_{21}\\ y_{22}\\ y_{23}\\ y_{31}\\ y_{32}\\ y_{33} \end{bmatrix}_1} = \prescript{}{n}{\begin{bmatrix} 5,0\\ 4,0\\ 3,0\\ 4,0\\ 6,0\\ 7,0\\ 8,0\\ 9,0\\ 8,0\\ 10,0 \end{bmatrix}_1}$


You have empty lines which you need to remove. Your code works then, but the subscripts are at different vertical positions because in order to compute the prescript the heights of 1 are added. To fix this, you can use \smash for the 1 subscripts.

\documentclass{article}
\usepackage{mathtools}
\begin{document}
$\prescript{}{n}{\begin{bmatrix} y_{11}\\ y_{12}\\ y_{13}\\ y_{14}\\ y_{21}\\ y_{22}\\ y_{23}\\ y_{31}\\ y_{32}\\ y_{33} \end{bmatrix}_{\smash{1}}} = \prescript{}{n}{\begin{bmatrix} 5,0\\ 4,0\\ 3,0\\ 4,0\\ 6,0\\ 7,0\\ 8,0\\ 9,0\\ 8,0\\ 10,0 \end{bmatrix}_{\smash{1}}}$
\end{document}


I suggest a different way, without \prescript.

\documentclass{article}
\usepackage{amsmath}
\usepackage{xparse}

\NewDocumentEnvironment{fbmatrix}{mmb}
{% #1 = left script, #2 = right script
{\vphantom{\begin{bmatrix}#3\end{bmatrix}}}_{#1\!\!}
\begin{bmatrix}#3\end{bmatrix}_{\!#2}
}{}

\begin{document}
$\begin{fbmatrix}{n}{1} y_{11}\\ y_{12}\\ y_{13}\\ y_{14}\\ y_{21}\\ y_{22}\\ y_{23}\\ y_{31}\\ y_{32}\\ y_{33} \end{fbmatrix} = \begin{fbmatrix}{n}{1} 5{,}0\\ 4{,}0\\ 3{,}0\\ 4{,}0\\ 6{,}0\\ 7{,}0\\ 8{,}0\\ 9{,}0\\ 8{,}0\\ 10{,}0 \end{fbmatrix}$
\end{document}


The contents of the matrix is typeset twice, but the same does \prescript. Here we have better control of the positioning of the subscripts.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\Large

\begin{tabular}{ccc}
{\begin{tabular}{c}
$\left[ \begin{tabular}{r}$ y_{11}$\\$ y_{12}$\\$ y_{13}$\\$ y_{14}$\\$y_{21}$\\$y_{22}$\\$y_{23}$\\$y_{31}$\\$ y_{32}$\\$y_{33}$\end{tabular}\right]$\\
n \hspace{1.1cm}    1
\end{tabular}}

&
=
&
{\begin{tabular}{c}

$\left[ \begin{tabular}{c} 5,0\\ 4,0\\ 3,0\\ 4,0\\ 6,0\\ 7,0\\ 8,0\\ 9,0\\ 8,0\\ 10,0 \end{tabular}\right]$\\
n \hspace{1.1cm} 1
\end{tabular}}
\end{tabular}
\end{document}


% I could not get superscript and prescript for the square brackets. For that I put n and 1 in such way that they look like superscripts. This makes one independent of packages.