# How to write the given block matrix

\begin{center}

$P=\left[ \begin{array}{c c c c c c c c c c c} a & 0 & 0 & \dots & 0 & 0 & \dots & 0 \\ 0 & & & & & & \\ 0 & & & & & & \\ \vdots & & & & & & \\ 0 & & & & & & \\ 0 & & & & & & \\ \vdots & & & & & & \\ 0 & & & & & & \end{array} \right]$

\end{center}


I want to write the matrix in the following way: But I dont know how to write the given matrix in the given form.

I have given the code on how to write the matrix. I just have problem in writing the matrix Q as given in the picture.

Can someone please help me

## 3 Answers

Nest matrices:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$P=\begin{bmatrix} a & \begin{matrix} 0 & 0 & \dots & 0 \end{matrix} \\ \begin{matrix} 0 \\ 0 \\ \vdots \\[1ex] 0 \end{matrix} & \text{\HugeQ} \end{bmatrix}$

\end{document} Don't use center around $...$. With use of the nicematrix package:

\documentclass[12pt,oneside]{article}
\usepackage{nicematrix}

\begin{document}
$P = \begin{bNiceArray}{C CCCC} a & 0 & 0 & \dots & 0 \\ 0 & \Block{4-4}<\huge>{Q} \\ 0 & & & & \\ \vdots & & & & \\ 0 & & & & \end{bNiceArray}$
\end{document}


For showed result you need to compile above MWE at least twice.

One more easy method is using \multicolumn and \multirow and the MWE is:

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

\begin{document}

$P=\begin{bmatrix} a & 0 & 0 & \dots & 0 \\ 0 \\ 0 &\multicolumn{4}{c}{\multirow{2}{*}{\Huge Q}}\\ \vdots \\ 0 & \end{bmatrix}$

\end{document} 