Indexing of a Matrix
Just like the elements of a vector are referred to as , where is the number of dimensions of the vector, there is a way to refer to elements of a matrix as well.
Referring to Elements of a Matrix
If we have a matrix (capital ), we refer to its elements as (lowercase ), where refers to the row the element finds itself in, and is its column.
Therefore, the first row of a matrix will have elements , where is the number of columns in the matrix.
The first column will have elements , where is the number of rows in the matrix.
For instance, a general matrix would look like this:
You can also use an uppercase (like ). You could say they are interchangeable, but it can also be a bit more subtle: explicitly refers to the entry of matrix at row and column , whereas denotes the more generic element in the matrix. They really refer to the same entry, but the uppercase version emphasizes the matrix while the lowercase version emphasizes its elements.
For you to better understand the subtle difference, here is an example. We have a matrix
As you can see, I used lowercase s to denote the elements in the matrix. But if I refer to a standalone element, I would use .
Sometimes, for convenience when typing on a keyboard, the notation is used to refer to an element of a matrix . The same idea applies: is the row, is the column.
For example, take the matrix
Then
Specifying the Size of a Matrix
When we refer to some matrix through its capital letter name, we can specify the size as an index: .
For instance, if the matrix has size , we can refer to it as , if we deem it to be important information in the current context.
Referring to an Entire Row or Column
We can use the notation to refer to the th row. Similarly, we can use to refer to the th column.
Sometimes, the notation and is used, but I will stick to the first version.
For instance, take the matrix
Then
and
is said to be a row vector, and is said to be a column vector.
I have not mentioned this in the chapter about vectors, but we have only ever worked with column vectors this far. Now you know that there is actually a difference between writing a vector as a column or row.
This concept is well-understood with the idea that I have touched upon in the chapter page about matrices. You can see vectors as a matrix with only one column. Basically, a column vector is a matrix of size , and a row vector is a matrix of size .