Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- approx = np.array((n, 1))
- for i in range(0, iteration):
- j = (i-1) % m
- predx = approx
- approx = approx + np.multiply((f[:,j] - A[j,:].dot(approx)),(np.transpose(A[j, :])))
- plt.plot([pred[0], approx[0]], [pred[1], approx[1]], "r-")
- c = plt.plot([predx[1], approx[1]], [predx[2], approx[2]], "g-")
- pause(0.01)
- delete(c)
- if(la.norm(predx - approx) <= precision):
- break
Add Comment
Please, Sign In to add comment