# Introduction to Matrices

November 29, 2020 2021-10-04 7:57## Introduction to Matrices

A matrix is a 2-dimensional array made up of rows () and columns (). When discussing matrix dimensionality, the standard convention is to specify the number of rows before the number of columns.

For example, if we have a matrix .

The matrix has 2 rows (horizontal) and 3 columns (vertical), and the matrix is said to be a 2 3 matrix with 6 elements. Here, 2 3 is known as the order or the dimension of the matrix. Now that we have a basic idea of what matrices are, let us learn about some of the matrix operations.

## Matrix Addition and Subtraction

Addition and subtraction are one of the most fundamental numerical matrix operations. Matrices can be added and subtracted from one another, provided each matrix has an identical number of rows and columns, i.e., the matrices have the same dimension. When adding/subtracting matrices, each element of each matrix is added/subtracted to/from the corresponding elements of the other matrix.

For example, if we have two matrices and .

Then, the matrix addition of and is obtained as,

Similarly, the matrix subtraction of and is given as,

Matrix addition and subtraction follow a property known as **commutativity**. The result of matrix addition and subtraction is commutative, which means that the order in which we conduct the operations does not matter. We will end up with the same result regardless of the order, i.e., and . We will see an example of matrix multiplication, where this property does not apply in the next lesson of this course.

## Scalar multiplication of matrices

A scalar value is a value with zero dimensions. In simple words, it is a number. For some scalar , the result of multiplied by some matrix is a matrix populated by the elements of multiplied by .

For example, if we take and multiply it with a matrix , then the result is obtained as,

In this lesson, we discussed the fundamental idea of matrices and some of the primary operations of matrices. Head onto the next lesson on ‘Dot Products and Matrix Multiplication‘ to discuss some of the more complex matrix operations such as the dot product and matrix multiplication.