# Latex Matrix

A matrix is defined as a set of numbers called elements arranged in the form of rows and columns so as to from the rectangular array. It has wide applications and are used for various purposes.

The environment is used to implement the matrix, which is given below:

The ampersand (&) symbol separates the columns in the matrix.

We can add as many rows and columns in the matrix according to the requirements.

The rows are separated by the \\ command, which is commonly used to specify the text in the new line.

The matrix environment is implemented using the \ and [.

It is written as:

Without the use of the above environment, the Texmaker will give an error.

Let's understand with a simple example. The example is a 2 x 2 matrix. It is a matrix that has two rows and two columns.

The code for such an example is given below:

Output:

There are different matrix environments used to create different styles of brackets for a matrix, which are listed below:

Environment Surrounding Bracket
pmatrix ( )
Bmatrix { }
bmatrix [ ]
Vmatrix || ||
vmatrix | |

The starred version of the above environments is used to align the columns of the matrix, which is listed below:

Environment Surrounding Bracket
pmatrix* ( )
Bmatrix* { }
bmatrix* [ ]
Vmatrix* || ||
vmatrix* | |

Let's understand the above aligning process by an example. The example is of 3 x 3 matrix having three rows and columns.

The code for such an example is given below:

Output:

You can also design the arbitrary sized matrix. The dots between the matrices can be specified by using the \ddots (⋱), \vdots (⋮), and \cdots (⋯) command.

The code to create such matrix is given below:

Output:

## Matrix with Text

In the running text, we can insert the matrix. The matrix of such type is termed as the small matrix.

The environment used to create small matrix is given below:

But here, we need to specify that the size of text should be greater than that of the matrix.

Let's understand with an example.

The code is given below:

Output:

## Border Matrix

The border matrix is used to create the borders around the matrix. The \bordermatrix command is used to implement such matrices.

The code for such an example is given below:

Output:

## Fraction Matrix

The fraction matrix consists of the fraction elements. We can also insert non-fraction elements according to the requirements.

Let's understand with a simple example. Here, we have used the Vmatrix environment.

The code for such an example is given below:

Output:

## Arrays

The array is similar to the matrix. But here, we can insert lines between rows and columns.

The environment used for such purpose is given below:

Let's understand with two examples.

The code for the first example is given below:

Output:

The code for the second example is given below:

Output:

### Cases

1) The curly brackets in mathematics are defined by using the \left{ and \right} command.

Let's understand by two examples.

The code for the first example is given below:

Output:

2) It is the crucial part of the cases. Here, the cases environment is used to implement such methods, which is written as:

The above environment is commonly used in mathematics to write two equations with certain conditions inside only single brackets.

The code for the second example is given below:

Output:

Next TopicLatex Integral