I am new to latex and I am trying to create this:

So far I have been able to create the matrices, like so:
\[
N\textrm{ spectra}
\begin{bmatrix}
a_{11} & a_{12} & \cdots & a_{1M} \\
a_{21} & a_{22} & \cdots & a_{2M} \\
\vdots & \vdots & \ddots & \vdots \\
a_{N1} & a_{N2} & \cdots & a_{NM}
\end{bmatrix}\\
\quad
\begin{bmatrix}
e_1 \\
e_2 \\
\vdots \\
e_N
\end{bmatrix}
\]
Does anyone know how can I add text above the matrices?


kbordermatrixto your answer for the sake of completeness? It can be found on this page. And the documentation is on this link – percusse Jun 18 '12 at 14:13