Guest User

Untitled

a guest
Oct 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. approx = np.array((n, 1))
  2. for i in range(0, iteration):
  3. j = (i-1) % m
  4. predx = approx
  5. approx = approx + np.multiply((f[:,j] - A[j,:].dot(approx)),(np.transpose(A[j, :])))
  6.  
  7. plt.plot([pred[0], approx[0]], [pred[1], approx[1]], "r-")
  8. c = plt.plot([predx[1], approx[1]], [predx[2], approx[2]], "g-")
  9. pause(0.01)
  10. delete(c)
  11.  
  12. if(la.norm(predx - approx) <= precision):
  13. break
Add Comment
Please, Sign In to add comment