Guest User

Untitled

a guest
Dec 14th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import numpy as np
  2.  
  3. A = np.matrix([[1,2,3], [4,5,6], [7,8,9]])
  4. x = np.matrix([[1], [0], [0]])
  5.  
  6. A*x
  7. """
  8. outputs:
  9. ([[1],
  10. [4],
  11. [7]])
  12. """
  13.  
  14. # Can be done with arrays as well!
  15. A = np.array([[1,2,3], [4,5,6], [7,8,9]])
  16. x = np.array([[1], [0], [0]])
  17. A.dot(x) # same output!
Add Comment
Please, Sign In to add comment