import numpy as np
import numpy.linalg as la
import matplotlib.pyplot as pt
%matplotlib inline
from time import process_time
def get_solve_time(n):
A = np.random.randn(n, n)
B = np.random.randn(n, n)
t_start = process_time()
A @ B
t_stop = process_time()
return t_stop-t_start
n_values = np.array([100,1000,2000,3000,4000,5000,6000,8000,10000])
print(n_values)
times = []
for n in n_values:
newtime = get_solve_time(n)
times.append(newtime)
pt.loglog(n_values, times)
pt.xlabel('n')
pt.ylabel('time')
pt.grid()