Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. import numpy as np
  2.  
  3. A = np.array([[-1, 0,0,0],[1,-1,0,0],[1,1,-1,0],[1,1,1,-1]])
  4.  
  5. print(A)
  6.  
  7. cond = np.linalg.cond(A)
  8. print(cond)
  9.  
  10. B = np.diag(np.diag(A))
  11. print(B)
  12.  
  13. C = A-B
  14. print(C)
  15.  
  16. cond = np.linalg.cond(C)
  17.  
  18. print(cond)
  19.  
  20. inf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement