1

I want some help, with this script :

\begin{center}
A = \begin{pmatrix}
0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{pmatrix}
\end{center}

I get this Matrix :

enter image description here

But I want a matrix like this :

enter image description here

Can you help me ?

1

You also can do it with blkarray:

\documentclass{article}
\usepackage{mathtools,blkarray}

\begin{document}

\[ \newcounter{rowct}\newcounter{colct}%\setlength\extrarowheight{1cm}
A =
\begin{blockarray}{*{11}{c}}
\begin{block}{r*{10}{>{\refstepcounter{colct}\mathclap{\mathbf\thecolct}}c}}
 & & & & & & & & & & \\%[-1ex]
 \end{block}
 \begin{block}{ >{\refstepcounter{rowct}\mathbf\therowct}r( >{\hspace{0.2em}}*{10}{c} <{\hspace{0.2em}})}
  &0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \rule{0pt}{3.5ex} \\
 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
& 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\
 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\
 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\
 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\
 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\[1ex]
 \end{block}
\end{blockarray}
\]
\end{document} 

enter image description here

2

In this particular case, a simple fix is:

\documentclass{article}
\usepackage{amsmath,stackengine}
\stackMath
\begin{document}
\[
A = 
\begin{matrix}
1\\2\\3\\4\\5\\6\\7\\8\\9\\10
\end{matrix}
\stackon[1pt]{\begin{pmatrix}
0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{pmatrix}
}{
\begin{matrix}
~1&2&3&4&5&6&7&8&9&10
\end{matrix}
}
\]
\end{document}

enter image description here

If you indeed wanted the labels in bold,

\documentclass{article}
\usepackage{amsmath,tabstackengine}
\TABstackTextstyle{\bfseries}
\setstacktabbedgap{9.2pt}
\begin{document}
\[
A = 
\tabbedCenterstack[r]{1\\2\\3\\4\\5\\6\\7\\8\\9\\10}
\stackon[1pt]{$\begin{pmatrix}
0 & 1 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\
0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\
\end{pmatrix}$%
}{%
\;\;\tabbedCenterstack{1&2&3&4&5&6&7&8&9&10}%
}
\]
\end{document}

enter image description here

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.