23 lines
464 B
Python
23 lines
464 B
Python
# 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)
|