# Math Help - part of code involved in matrices

1. ## part of code involved in matrices

what does in \begin{array}{ccccc} what does the cccccc do and how is the number of characters determined? for example, do I need 5 c's for a matrix that has 5 columns or something?

2. Originally Posted by superdude
what does in \begin{array}{ccccc} what does the cccccc do and how is the number of characters determined? for example, do I need 5 c's for a matrix that has 5 columns or something?
Yes, the number of letters in the second set of brackets indicates the number of columns. You can list either a "c", "r", or "l" to signify the justification of the numbers in the matrix. So, for example, in the command you listed, you have five columns with the numbers centered in each column.

3. You can have more c's than required:

$\left[\begin{array}{ccc}1&2\\3&4\\5&6\end{array}\right]$

which allows you to leave blank spaces:

$\left[\begin{array}{ccc}1&2&3\\&4\\5&6\end{array}\right]$

- Hollywood