I am trying to make a matrix with external elements and dashed separation lines for clarification. I have gotten pretty far using the blkarray package. However, I have failed to add a horizontal separation line between rows f and g, only inside the matrix. Also, I would like the separation lines to be dashed.
EDIT:
Sorry, I should have been more explicit. I would like both separation lines to be dashed. Will try no if this works with any of the provided answers.
\documentclass{article} \usepackage{amsmath} \usepackage{blkarray} \begin{document} \begin{equation} H = \begin{blockarray}{ccccc} & a & b & c & d\\ \begin{block}{c(cc|cc)} e & 1 & 2 & 3 & 4\\ f & 5 & 6 & 7 & 8\\ g & 9 & 0 & 1 & 2\\ h & 3 & 4 & 5 & 7\\ \end{block} \end{blockarray} \end{equation} \end{document} 


