braces on the sides of an easybmat matrix

I created the following matrix with easybmat, and I would like to add at the bottom (respectively right) something like an underbrace (resp. "rightbrace") under each of the two blocks, together with a number specifying the number of columns (resp. rows) of the block. This amounts to two braces on the bottom and two on the right, and each brace should have a number below (resp. at the right) of it.

I did not find anything about that on the easybmat manual. I think I see how to do the braces with the blkarray package, but then I am not able to create the block structure of the matrix in the first place.

\documentclass{article}
\usepackage{easybmat}
\begin{document}
$M(z)= \left[ \begin{BMAT}[5pt]{c|c}{c} \begin{BMAT}[5pt]{c:c:c}{ccccccc} & & \\ & & \\ & & \\ v_1 & \dots & v_m \\ & & \\ & & \\ & & \end{BMAT} & \begin{BMAT}{c}{c|c} \begin{BMAT}[5pt]{c:c:c}{ccc} & & \\ w_1(a) & \dots & w_n(a) \\ & & \end{BMAT} \\ \begin{BMAT}[10pt]{c}{c} B(z) \end{BMAT} \end{BMAT} \end{BMAT} \right]$
\end{document}


This is more or less what i wish:

-

For the vertical braces, you can use the bigdelim package; the horizontal braces were made using \underset and \underbrace and a "rule" of variable width and no height:

\documentclass{article}
\usepackage{amsmath}
\usepackage{easybmat}
\usepackage{multirow,bigdelim}

\newcommand*\hexbrace[2]{%
\underset{#2}{\underbrace{\rule{#1}{0pt}}}}

\begin{document}
$M(z)= \begin{array}{c@{}c} \left[ \begin{BMAT}[5pt]{c|c}{c} \begin{BMAT}[5pt]{c:c:c}{ccccccc} & & \\ & & \\ & & \\ v_1 & \dots & v_m \\ & & \\ & & \\ & & \end{BMAT} & \begin{BMAT}{c}{c|c} \begin{BMAT}[5pt]{c:c:c}{ccc} & & \\ w_1(a) & \dots & w_n(a) \\ & & \end{BMAT} \\ \begin{BMAT}[10pt]{c}{c} B(z) \end{BMAT} \end{BMAT} \end{BMAT} \right] & \begin{array}{l} \\[-8mm] \rdelim\}{4}{6mm}[J] \\ \\ \\[4mm] \rdelim\}{3}{6mm}[H] \\ \\ \end{array} \\[-1ex] \hexbrace{2.7cm}{m}\hexbrace{3.8cm}{n} \end{array}$

\end{document}


-
yes, that's nice. I wonder if there is an alternative way in which one does not have to manually specify the size of the braces, but in any case this serves my purposes very well. – vito Mar 19 '12 at 18:13
@vito: perhaps it could be done, but I don't know how to easily do it using easybmat. On a side note, I see that you haven't accepted any of the answers to your questions; please consider doing so. – Gonzalo Medina Mar 19 '12 at 18:25
ok, I've just accepted your answer. – vito Mar 19 '12 at 21:46

Do you mean something like this?

\documentclass{article}
\usepackage{easybmat}
\begin{document}
$M(z)= \left[ \begin{BMAT}[5pt]{c|c}{c} \underbrace{\left.\begin{BMAT}[5pt]{c:c:c}{ccccccc} & & \\ & & \\ & & \\ v_1 & \dots & v_m \\ & & \\ & & \\ & & \end{BMAT}\right\}6}_5 & \begin{BMAT}{c}{c|c} \begin{BMAT}[5pt]{c:c:c}{ccc} & & \\ w_1(a) & \dots & w_n(a) \\ & & \end{BMAT} \\ \begin{BMAT}[10pt]{c}{c} B(z) \end{BMAT} \end{BMAT} \end{BMAT} \right]$
\end{document}


(If you do mean something like that, the positioning of the braces would need some adjustment, but that's easily done if this is basically what you need)

-
in fact, the braces on the right should be on the right of the entire matrix (I have edited the question to show what I have in mind) – vito Mar 19 '12 at 13:57