This week, we talked about matrix addition, scalar multiplication, matrix multiplication, and the transpose. These all work pretty much how you would expect in Sage: Let’s create some matrices to play with: %typeset_mode True M = matrix([[1,2],[3,4],[5,6]]) N = matrix([[3,1],[4,1],[5,9]]) P = matrix([[2,7],[1,8]]) I = identity_matrix(3) Z = zero_matrix(3,2) R = random_matrix(ZZ, 2, 2) [M, […]
Categories
Archives