First version of lab_matrices

This commit is contained in:
cplockport
2026-03-02 12:29:18 -05:00
commit 8482cb6db5
12 changed files with 593 additions and 0 deletions

22
matrices.py Normal file
View File

@@ -0,0 +1,22 @@
# This script defines the matrices from the lab using numpy
# You should run it by calling `python -i matrices.py`
import numpy as np
a = np.array([[1, 2, 3]])
B = np.array([[6, 1],[1, 4]])
C = np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
D = np.array([[1, 1], [2, 2], [3, 3]])
E = np.array([[1, 2], [1, 2], [1, 2]])
print("The following matrices are defined:")
print('a')
print(a)
print('B')
print(B)
print('C')
print(C)
print('D')
print(D)
print('E')
print(E)