I need to assign a tag to each row and column of a matrix. Currently, I have only figured out how to create the matrix:

        \{q_0\} & \{q_0, q_1\} \\
        \{q_2\} & \emptyset \\
        \emptyset & \emptyset

Which yields the following matrix:

Matrix generated by LaTex

I need to add q_0, q_1 and q_2 tags to the rows and 0 and 1 tags to the columns as shown in the image below.

enter image description here

Is there any way to do this?


Since the solution with package blkarray isn't mentioned in the above link, I'll add it here:

\usepackage{amssymb, blkarray, bigstrut}


\[ \begin{blockarray}{rcc}
   & 0 & 1 \\
  q_0 & \{q_0\} & \{q_0,q_1\}\bigstrut[t] \\
q_1 & \{q_2\} & \varnothing \\
q_2 & \varnothing & \varnothing \\
\end{blockarray} \]%


enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.