Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How To Write Matrix In Latex?

  1. Dec 13, 2015 #1
    How do you write a matrix such as below image in Latex, in this forum?

    Matrix.png
     
  2. jcsd
  3. Dec 13, 2015 #2
  4. Dec 14, 2015 #3

    DrClaude

    User Avatar

    Staff: Mentor

    Normally, the easiest way to write a matrix is to use the pmatrix environment:
    Code (LaTeX):

    \begin{pmatrix}
    2 & 6 & 1 \\ 1 & 2 & -1 \\ 5 & 7 & -4
    \end{pmatrix
    }
     
    $$
    \begin{pmatrix}
    2 & 6 & 1 \\ 1 & 2 & -1 \\ 5 & 7 & -4
    \end{pmatrix}
    $$

    If you need the vertical line, you have to do the matrix "by hand," and it requires a bit more work:
    Code (LaTeX):

    \left(
    \begin{array}{rrr|r}
    2 & 6 & 1 & 7 \\ 1 & 2 & -1 & -1 \\ 5 & 7 & -4 & 9
    \end{array
    }
    \right)
     
    $$
    \left(
    \begin{array}{rrr|r}
    2 & 6 & 1 & 7 \\ 1 & 2 & -1 & -1 \\ 5 & 7 & -4 & 9
    \end{array}
    \right)
    $$
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: How To Write Matrix In Latex?
  1. Latex vs. writing math (Replies: 10)

Loading...