For some reason, the column doesn't align properly with matrix B. And I can't figure out why. I hate having to resort to using yshift this many millimeter this and this many millimeter for this.

\documentclass[11pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{arrows}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\definecolor{shade1}{rgb}{0.9, 0.9, 0.9}
\definecolor{shade2}{rgb}{0.8, 0.8, 0.8}
\definecolor{shade3}{rgb}{0.65, 0.65, 0.65}
\definecolor{shade4}{rgb}{0.45, 0.45, 0.45}
\begin{document}
\begingroup
\newlength{\matrixSize}
\setlength{\matrixSize}{2cm}
\newlength{\matrixSep}
\setlength{\matrixSep}{4mm}
\begin{tikzpicture}[%
auto,
box/.style={%
draw,
rectangle,
},
matrix/.style={%
box,
fill=shade2,
minimum size=2cm,
inner sep=0pt,
node distance=\matrixSep,
},
cell/.style={%
box,
fill=shade3,
minimum size=0.1\matrixSize,
inner sep=0pt,
},
]
% Matrices
\node [matrix] (C) {C};
\node [matrix, left=of C] (A) {A};
\node [matrix, above=of C] (B) {B};
% Cell to calculate in C
\node [cell] at ([xshift=-0.2\matrixSize, yshift=0.2\matrixSize]
C.south east) (cell) {};
% Row from A
\path let \p1 = (cell),
\p2 = (A.base),
\p3 = (A.west),
\p4 = (A.east)
in
node [%
cell,
minimum width=\x4-\x3-\pgflinewidth,
] at ([yshift=\y1-\y2] A.base) (row) {};
% Column from B
\path let \p1 = (cell),
\p2 = (B.base),
\p3 = (B.south),
\p4 = (B.north)
in
node [%
cell,
minimum height=\y4-\y3-\pgflinewidth,
] at ([xshift=\x1-\x2] B.base) (col) {};
\end{tikzpicture}
\endgroup
\end{document}



node [ cell, minimum height=\y4-\y3-\pgflinewidth, ] at ([xshift=\x1-\x2] B.center) (col) {};– Gonzalo Medina Sep 29 '11 at 17:35