A matrix is a rectangular array of numbers:
[A]=[1817.372.15.2]
It is no different than just a table of entries. A matrix is typically denoted with bracket $[A]$ or a boldface letter $\mathbf{A}$. Entries in a matrix can be shorthanded as $a_{ij}$ where $i$ is the row index and $j$ is the column index. For example, $a_{23} = 5.2$ in the previous matrix. If you can’t remember what the indices refer to, you can refer to the entries as $a_{rc}$ where $r$ is for row and $c$ is for column.
The power of matrices however lies in their ability to represent many mathematical systems – such as systems of linear equations. By analyzing the mathematical properties of a matrix, we can infer a lot of information about the physical system that the matrix represents.
In Python, you can represent matrices using the numpy library:
01 02 03 04 05 06 | # import numpy import numpy as np # create a 2x2 matrix as a list of lists A = np.array([ [ 1 , 2 ] , [ 3 , 5 ] ]) # print A print (A) |
You can experiment with your own matrices below:
Matrix-Vector Multiplication
Matrices and vectors can be multiplied when their sizes allow it. An $m\times n$ matrix can multiply a column vector of size $n \times 1$. The result and an $m\times 1$ column vector. In Python, matrix vector multiplication