# How to draw complex matrix?

I want to draw a complex matrix like following. Tried several times but still didn't get it. Help please!

Thank you!

Here is a solution with blkarray:
    \documentclass{article}
$\makeatletter\global\setlength\BA@colsep{3pt}\setlength{\arraycolsep}{3pt}\makeatother \begin{blockarray}{(c<{\hspace{-0.95em}})} \begin{blockarray}{*{5}{c}} \begin{block}{*{5}{c} <{\hspace{1em}}\Right{\}}{ x }} 0 & ... & 0 & ... & 0 \bigstrut[t]\\ ⋮ & ⋱ & ⋮ & ⋱ & ⋮ \\ 0 & ... & 0 & ... & 0\\ \end{block} \begin{block}{*{3}{c}\BAmultirow{4mm}\BAmultirow{2mm}} ⋮ & ⋱ & ⋮ & \BAmulticolumn{2}{l}{\: \mbox{\Large A }} \\ \BAmulticolumn{3}{c}{\smash{\underbrace{\begin{matrix}0 & \mkern 1mu ... & \: 0\end{matrix}}_{\textstyle y}}}\\[-2ex] \end{block} \end{blockarray} \end{blockarray}$