Advertisement
Fhernd

calculo-matricial.py

May 31st, 2018
2,038
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import numpy as np
  2. from numpy import linalg
  3.  
  4. matriz = np.matrix([[-2, 3, -5], [2, 3, 5], [7, 11, 13]])
  5.  
  6. print(matriz)
  7. print('')
  8. # Transpuesta:
  9. print(matriz.T)
  10. print('')
  11. # Inversa:
  12. print(linalg.inv(matriz))
  13. print('')
  14. # Producto por vector:
  15. vector = np.matrix([[2], [3], [5]])
  16.  
  17. print(vector)
  18. print(matriz * vector)
  19. print('')
  20. # Determinante:
  21. print(linalg.det(matriz))
  22. print('')
  23. # Valores propios:
  24. print(linalg.eigvals(matriz))
  25. print('')
  26. # Solución de sistemas de ecuaciones:
  27. print(linalg.solve(matriz, vector))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement