# Thread: How do you write matrices

1. ## How do you write matrices

Hey, this is to the mods and helpers or anyone who knows latex.

How do i type a 3 x 3 matrix or larger in latex on this discussion board.

2. Originally Posted by tsal15
Hey, this is to the mods and helpers or anyone who knows latex.

How do i type a 3 x 3 matrix or larger in latex on this discussion board.
The latex code for $\left( \begin{array}{ccc}
a & b & c \\
& \\
d & e & f \\
& \\
g & h & i \end{array}\right)$
is:

$$\left( \begin{array}{ccc} a & b & c \\ & \\ d & e & f \\ & \\ g & h & i \end{array}\right)$$

I'm sure you can figure out how to change the order (size) of the matrix ....

3. Originally Posted by mr fantastic
The latex code for $\left( \begin{array}{ccc}
a & b & c \\
& \\
d & e & f \\
& \\
g & h & i \end{array}\right)$
is:

$$\left( \begin{array}{ccc} a & b & c \\ & \\ d & e & f \\ & \\ g & h & i \end{array}\right)$$

I'm sure you can figure out how to change the order (size) of the matrix ....
Alternatively...

$$\left[ \begin{array}{ccc} a & b & c \\ & \\ d & e & f \\ & \\ g & h & i \end{array}\right]$$

gives

$\left[ \begin{array}{ccc}
a & b & c \\
& \\
d & e & f \\
& \\
g & h & i \end{array}\right]$

4. ## LaTeX

Hello -

Originally Posted by tsal15
Hey, this is to the mods and helpers or anyone who knows latex.

How do i type a 3 x 3 matrix or larger in latex on this discussion board.
Yes, I'm new to LaTeX as well. I've found the Wikibooks page pretty helpful so far. It's at LaTeX/Mathematics - Wikibooks, collection of open-content textbooks.

Does anyone know of a better reference page?

5. Originally Posted by Prove It
Alternatively...

$$\left[ \begin{array}{ccc} a & b & c \\ & \\ d & e & f \\ & \\ g & h & i \end{array}\right]$$

gives

$\left[ \begin{array}{ccc}
a & b & c \\
& \\
d & e & f \\
& \\
g & h & i \end{array}\right]$
or Alternatively...

$$\begin{bmatrix} a&b&c\\ d&e&f\\ g&h&i\end{bmatrix}$$

gives you

$\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}$

6. Originally Posted by Chris L T521
or Alternatively...

$$\begin{bmatrix} a&b&c\\ d&e&f\\ g&h&i\end{bmatrix}$$

gives you

$\begin{bmatrix}a&b&c\\d&e&f\\g&h&i\end{bmatrix}$
so how about augmented matrices? :P

7. Originally Posted by tsal15
so how about augmented matrices? :P
$\left[ \begin{array}{ccc|c}
a & b & c & u\\
d & e & f & v\\
g & h & i & w\end{array}\right]$

$$\left[ \begin{array}{ccc|c} a & b & c & u\\ d & e & f & v\\ g & h & i & w\end{array}\right]$$

CB

8. Originally Posted by CaptainBlack
$\left[ \begin{array}{ccc|c}
a & b & c & u\\
d & e & f & v\\
g & h & i & w\end{array}\right]$

$$\left[ \begin{array}{ccc|c} a & b & c & u\\ d & e & f & v\\ g & h & i & w\end{array}\right]$$

CB
is there a way to write it without the array and ccc|c bit? i've seen other methods to write matrices which don't require the array and ccc bit... but thanks all the same always an honor to have you reply my threads

9. Originally Posted by tsal15
is there a way to write it without the array and ccc|c bit? i've seen other methods to write matrices which don't require the array and ccc bit... but thanks all the same always an honor to have you reply my threads
One trick when faced with programming is to find a minimal subset of commands which can acheive any desired result, it minimises errors because you are using the same commands all of the time.

The same thing applies to LaTeX, the array comand is a usefull command for setting this sort of thing up, and specifying how you want it displayed (that is what the {ccc|c} is doing it is specifying the cells be centred and there is a vertical seperator between columns 3 and 4). And as these things can be done with it I would prefer to use it.

CB

10. I wanted to know how to type a joint probability distribution with X and Y on the sides. I use emtex I believe, not Latex. In any case I gave up and wrote the distribution in by hand.