daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Mar 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import numpy as np
  2. mat1 = np.array([[2,4,-2],[4,-2,6],[6,-4,2]],dtype=float)
  3. matr = np.array([[-10],[20],[18]],dtype=float)
  4. mat3 = np.zeros([3])
  5. for i in range(len(mat3)-1,-1,-1):
  6.   for j in range(i+1,len(mat3)):
  7.     matr[i] += -1*mat1[i][j] * mat3[j]
  8.     mat1[i][j] = 0
  9.   mat3[i] = matr[i]/mat1[i][i]
  10. print("Results: {}".format(mat3))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top