[Tex/LaTex] vertical dotted line in column vector / amsmath matrix

amsmathmatrices

I would like to typeset the following set of equations:
enter image description here

… but with contiguous, vertical dotted lines in the column vectors, such that the top and bottom rows of the matrix and of the vectors are well aligned.

\vdots doesn't seem to be the right choice here, as I used it to produce the graphic above. The code is the following:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{equation}
  \begin{pmatrix}
    a_1 & b_1 &     &     &     &\\
    c_2 & a_2 & b_2 &     &     &\\
        & c_3 & a_3 & b_3 &     &\\
        &     & c_4 & a_4 & b_4 &\\
        &     &     & c_5 & a_5 & b_5\\
        &     &     &     & c_6 & a_6
  \end{pmatrix}
  \begin{pmatrix}
    T_1\\
    \vdots\\
    \vdots\\
    \vdots\\
    \vdots\\
    T_6
  \end{pmatrix}=
  \begin{pmatrix}
    d_1\\
    \vdots\\
    \vdots\\
    \vdots\\
    \vdots\\
    d_6
  \end{pmatrix}
\end{equation}
\end{document} 

If this isn't good style in terms of mathematical notation conventions (which I don't know), then, of course, I would write out the elements of the vectors. Clarification would be welcome.

Best Answer

You can do it like this, provided your main matrix has no unusually big objects (otherwise you can play with the first argument to \dottedcolumn that also accepts decimal numbers).

\documentclass{article}
\usepackage{amsmath}

\newcommand{\dottedcolumn}[3]{%
  \settowidth{\dimen0}{$#1$}
  \settowidth{\dimen2}{$#2$}
  \ifdim\dimen2>\dimen0 \dimen0=\dimen2 \fi
  \begin{pmatrix}\,
    \vcenter{
      \kern.6ex
      \vbox to \dimexpr#1\normalbaselineskip-1.2ex{
        \hbox{$#2$}
    \kern3pt
    \xleaders\vbox{\hbox to \dimen0{\hss.\hss}\vskip4pt}\vfill
    \kern1pt
    \hbox{$#3$}
  }\kern.6ex}\,
  \end{pmatrix}
}

\begin{document}
\begin{equation}
  \begin{pmatrix}
    a_1 & b_1 &     &     &     &\\
    c_2 & a_2 & b_2 &     &     &\\
        & c_3 & a_3 & b_3 &     &\\
        &     & c_4 & a_4 & b_4 &\\
        &     &     & c_5 & a_5 & b_5\\
        &     &     &     & c_6 & a_6
  \end{pmatrix}
  \dottedcolumn{6}{T_1}{T_6}=\dottedcolumn{6}{d_1}{d_6}
\end{equation}
\end{document} 

enter image description here