Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- A = np.matrix([[1,2,3], [4,5,6], [7,8,9]])
- x = np.matrix([[1], [0], [0]])
- A*x
- """
- outputs:
- ([[1],
- [4],
- [7]])
- """
- # Can be done with arrays as well!
- A = np.array([[1,2,3], [4,5,6], [7,8,9]])
- x = np.array([[1], [0], [0]])
- A.dot(x) # same output!
Add Comment
Please, Sign In to add comment