I have a matrix containing the values 0 and 1. The first column contains n_1 values of 1 and the rest is 0. The second column begins with n_1 values of 0, n_2 values of 1 and then 0 for the rest. I want to make { outside my matrix, to write n_1, n_2, etc., but I want the bracket { to expand over several lines. How can I do that?
\documentclass[11pt]{memoir}
\usepackage{amsmath}
\begin{document}
\begin{align}
\begin{pmatrix}
1 & 0 & 0 & \cdots & 0 & 0 \\
\vdots & \vdots & \vdots & & \vdots & \vdots \\
1 & 0 & 0 & \cdots &0 & 0 \\
0 & 1 & 0 & \cdots &0& 0 \\
\vdots & \vdots & \vdots & &\vdots& \vdots \\
0 & 1 & 0 & \cdots &0& 0 \\
\vdots & \vdots & \vdots & & \vdots &\vdots \\
0 & 0 & 0 & \cdots &0& 1 \\
\vdots & \vdots & \vdots & &\vdots& \vdots \\
0 & 0 & 0 & \cdots &0& 1 \\
\end{pmatrix}
\end{align}
\end{document}