Results 1 to 4 of 4

Math Help - Matrices on same line?

  1. #1
    Junior Member
    Joined
    Jan 2009
    Posts
    36

    Matrices on same line?

    I have two 6x6 matrices in a latex document, and I want them to appear on the same line in the pdf document. At the moment, the second one just sits below the first one. Can anyone help?

    Thanks,

    David


    This is the code I have for the matrices:


    \[ \left( \begin{array}{cccccc}
    1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0 \\
    0 & 0 & 0 & 1 & 0 & 0 \\
    0 & 0 & 0 & 0 & 1 & 0 \\
    0 & 0 & 0 & 0 & 0 & 1
    \end{array} \right)\]


    \[ \left( \begin{array}{cccccc}
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0
    \end{array} \right)\]
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member
    Joined
    Nov 2009
    Posts
    263
    try this :
    Code:
    \begin{array}
    [c]{cc}%
    \left(
    \begin{array}
    [c]{cccccc}%
    1 & 0 & 0 & 0 & 0 & 0\\
    0 & 1 & 0 & 0 & 0 & 0\\
    0 & 0 & 1 & 0 & 0 & 0\\
    0 & 0 & 0 & 1 & 0 & 0\\
    0 & 0 & 0 & 0 & 1 & 0\\
    0 & 0 & 0 & 0 & 0 & 1
    \end{array}
    \right)   & \left(
    \begin{array}
    [c]{cccccc}%
    1 & 0 & 0 & 0 & 0 & 0\\
    1 & 0 & 0 & 0 & 0 & 0\\
    1 & 0 & 0 & 0 & 0 & 0\\
    1 & 0 & 0 & 0 & 0 & 0\\
    0 & 1 & 0 & 0 & 0 & 0\\
    0 & 0 & 1 & 0 & 0 & 0
    \end{array}
    \right)
    \end{array}
    \begin{array}<br />
[c]{cc}%<br />
\left(<br />
\begin{array}<br />
[c]{cccccc}%<br />
1 & 0 & 0 & 0 & 0 & 0\\<br />
0 & 1 & 0 & 0 & 0 & 0\\<br />
0 & 0 & 1 & 0 & 0 & 0\\<br />
0 & 0 & 0 & 1 & 0 & 0\\<br />
0 & 0 & 0 & 0 & 1 & 0\\<br />
0 & 0 & 0 & 0 & 0 & 1<br />
\end{array}<br />
\right)   & \left(<br />
\begin{array}<br />
[c]{cccccc}%<br />
1 & 0 & 0 & 0 & 0 & 0\\<br />
1 & 0 & 0 & 0 & 0 & 0\\<br />
1 & 0 & 0 & 0 & 0 & 0\\<br />
1 & 0 & 0 & 0 & 0 & 0\\<br />
0 & 1 & 0 & 0 & 0 & 0\\<br />
0 & 0 & 1 & 0 & 0 & 0<br />
\end{array}<br />
\right)<br />
\end{array}
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Jan 2009
    Posts
    36
    Thanks, I can't get that to work however. It says there is something wrong with the parts with the % sign, e.g.

    [c]{cc}%

    I tried it without the %s as well but no luck again.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Opalg's Avatar
    Joined
    Aug 2007
    From
    Leeds, UK
    Posts
    4,041
    Thanks
    7
    Quote Originally Posted by bobby View Post
    I have two 6x6 matrices in a latex document, and I want them to appear on the same line in the pdf document. At the moment, the second one just sits below the first one. Can anyone help?

    Thanks,

    David


    This is the code I have for the matrices:


    \[ \left( \begin{array}{cccccc}
    1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0 \\
    0 & 0 & 0 & 1 & 0 & 0 \\
    0 & 0 & 0 & 0 & 1 & 0 \\
    0 & 0 & 0 & 0 & 0 & 1
    \end{array} \right)\]


    \[
    \left( \begin{array}{cccccc}
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0
    \end{array} \right)\]
    Leave out the bits in red. The command \] closes a displayed equation, and the command \[ starts a new one (on a new line).

    For matrices, it's usually more convenient to use the matrix environment instead of the array environment. Use \begin{pmatrix} for a matrix in parenthetical brackets, or \begin{bmatrix} for square brackets. For example,

    \begin{bmatrix}
    1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0 \\
    0 & 0 & 0 & 1 & 0 & 0 \\
    0 & 0 & 0 & 0 & 1 & 0 \\
    0 & 0 & 0 & 0 & 0 & 1
    \end{bmatrix}

    \begin{bmatrix}
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 & 0 & 0 \\
    0 & 0 & 1 & 0 & 0 & 0
    \end{bmatrix}

    will produce \begin{bmatrix}1 & 0 & 0 & 0 & 0 & 0 \\<br />
 0 & 1 & 0 & 0 & 0 & 0 \\<br />
 0 & 0 & 1 & 0 & 0 & 0 \\<br />
 0 & 0 & 0 & 1 & 0 & 0 \\<br />
 0 & 0 & 0 & 0 & 1 & 0 \\<br />
 0 & 0 & 0 & 0 & 0 & 1<br />
 \end{bmatrix}\begin{bmatrix}<br />
 1 & 0 & 0 & 0 & 0 & 0 \\<br />
 1 & 0 & 0 & 0 & 0 & 0 \\<br />
 1 & 0 & 0 & 0 & 0 & 0 \\<br />
 1 & 0 & 0 & 0 & 0 & 0 \\<br />
 0 & 1 & 0 & 0 & 0 & 0 \\<br />
 0 & 0 & 1 & 0 & 0 & 0<br />
 \end{bmatrix}.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 3
    Last Post: November 4th 2011, 06:42 PM
  2. Replies: 2
    Last Post: November 25th 2010, 06:34 PM
  3. singular matrices line of zeros idification 4
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: November 17th 2010, 02:24 AM
  4. Total matrices and Commutative matrices in GL(r,Zn)
    Posted in the Advanced Algebra Forum
    Replies: 8
    Last Post: August 16th 2010, 02:11 AM
  5. Replies: 0
    Last Post: October 22nd 2009, 11:04 AM

Search Tags


/mathhelpforum @mathhelpforum