# Vertical alignment of rows within a matrix

For a simple matrix equation as the one below, I get the matrix entries bottom-aligned instead of center-aligned. I found some fancy row editing on StackExchange that use arraystretch, vphantom, struts, etc. Mine is a simple equation that I'd like to have vertically centered with the equal sign. This is for an IEEE paper, so I'm using IEEEtran.cls in case that matters. I'd appreciate any suggestions.

$$z =& \begin{bmatrix} H & \vdots & M \end{bmatrix}\begin{bmatrix} x \\ \cdots \\ f\end{bmatrix} + e\\$$


• You're mixing up the dots: they should be centered in the row and vertical in the column. Anyway, you can get the vertical ones not taking too much space with \smash{\vdots} – egreg Oct 7 '18 at 15:43
• You could also do \begin{bmatrix} H & \vdots & M\\[-8pt] \\ \end{bmatrix} to make the matrix more symmetric. BTW, in an equation you are not to put alignment characters, i.e. remove the & after =. – user121799 Oct 7 '18 at 15:47
• I think you are referring to the horizontal matrix, try to use the \vspace{} with some negative number, like -3pt in it. You'll have to adjust it manually but it works. – Edoardo Serra Oct 7 '18 at 16:03
• @egreg \smash worked fine, as well as the version @marmot suggested. The spacing looks a little better using marmot's suggestion. – Bil Oct 7 '18 at 18:06

You've not provided a MWE so I'm assuming you are using the standard 10pt article class.

As egreg correctly said you're mixing up vertical and horizontal dots, but still here is a solution for your problem:

\documentclass[10pt]{article}
\usepackage{amsmath}

\begin{document}
$$z = \begin{bmatrix} \vspace{1.5pt}H & \vdots & \vspace{1.5pt}M \end{bmatrix}\begin{bmatrix} x \\ \cdots \\ f\end{bmatrix} + e\\$$
\end{document}


I've also removed the & after the equal sign, the output is this: