2

Block diagonal matrix

The code:

$$[T]_{\beta}=\begin{bmatrix}
c_{1}&&\\
        &\ddots& \\
          &&c_{1}
\end{bmatrix}
$$

I am trying with this code but ended up having a normal diagonal matrix. I want a block diagonal matrix that is drawn in the picture. A block diagonal matrix is a matrix whose diagonal entries consist of small n-order matrix. This is actually what the matrix should look like this but I have no idea how to do it. I attached the code here and I will attach my file screenshot.

enter image description here

There is no error in my code but the problem is I have no idea to make this type of matrix. I saw many examples online and in tex exchange but they are not useful for me.

9
  • Welcome to TEX.SE! Please show us the complete compilable TeX code you have tried so far ...
    – Mensch
    Commented May 29, 2023 at 18:08
  • Actually I am writing in miktex and I mentioned above what I able to write so far.
    – RIPAN DAS
    Commented May 29, 2023 at 18:13
  • Maybe you could get some ideas here: tex.stackexchange.com/q/585487 Commented May 29, 2023 at 18:48
  • And I don't know what is the problem with stack exchange that it closes all my problems by saying it need for clarity. I put enough details in my question. Please someone clarify this also. I saw many questions in SE that doesn't have much details. What is the problem with me.
    – RIPAN DAS
    Commented May 30, 2023 at 13:54
  • Here's a clarity check for you: 1) Copy your posted code into a new .tex file. 2) Compile it. 3) Add missing parts, until it compiles. 4) Make sure, it still shows your problem. 5) Post that one instead. Comparing with your current code should make the "clarity" request self-evident.
    – MS-SPO
    Commented May 30, 2023 at 15:24

2 Answers 2

3

With {bNiceMatrix} of nicematrix.

\documentclass{article}
\usepackage{nicematrix}

\setcounter{MaxMatrixCols}{20}

\begin{document}

\setlength{\arraycolsep}{4pt}

$\begin{bNiceMatrix}[margin]
\Block[borders={bottom,right}]{4-4}{}
c_1\\
   &c_1\\
   &   &\Ddots\\
   &   &      &c_1&\Block[l]{1-4}{\scriptstyle d_1\times d_1}\\
   &   &      &   &\Block[draw]{4-4}{}
                   c_2\\
   &   &      &   &   &c_2\\
   &   &      &   &   &   &\Ddots\\
   &   &      &   &   &   &      &c_2&\Block[l]{1-4}{\scriptstyle d_2\times d_2}\\\\
   &   &      &   &   &   &      &   &\ddots\\
   &   &      &   &   &   &      &   &      &\Block[draw]{4-4}{}
                                             c_n\\
   &   &      &   &   &   &      &   &      &   &c_n\\
   &   &      &   &   &   &      &   &      &   &   &\Ddots\\
   &   &      &   &   &   &      &   &      &   &   &      &c_n&\scriptstyle d_n\times d_n \\
\end{bNiceMatrix}$

\end{document}

Output of the above code

0

Something like this?

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{pmatrix}
c_{11} \\
& \ddots \\
& & c_{nn}
\end{pmatrix}
\]
\end{document}
3
  • Nope. I want block diagonal matrix
    – RIPAN DAS
    Commented May 30, 2023 at 13:50
  • Well, just change c_{ii} to C_{i} and declare the C_i matrices to be square.
    – Mico
    Commented May 30, 2023 at 16:58
  • I can do it but i want above mentioned matrix that matrix can be seen in many books of linear algebra.
    – RIPAN DAS
    Commented Jul 26, 2023 at 7:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .