An Introduction to Python For Undergraduate Engineers/Matrices

Matrices can be created in the following way:

mymatrix = Matrix(1,2],[3,4)

In this example, [1,2] produces the first line of the matrix and [2,3] creates the second.

Quick Standard Matrices
The following built in functions can be used to quickly create some standard matrices of specified size.

Getting the Size of a Matrix
You can find out the size of a matrix using the .shape[] command, for example:

mymatrix.shape[0]