Created
May 31, 2018 12:44
-
-
Save Fhernd/ffe57e3f8ea3ee42758adb4b7f769193 to your computer and use it in GitHub Desktop.
Operaciones en álgebra lineal. OrtizOL.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numpy import linalg | |
matriz = np.matrix([[-2, 3, -5], [2, 3, 5], [7, 11, 13]]) | |
print(matriz) | |
print('') | |
# Transpuesta: | |
print(matriz.T) | |
print('') | |
# Inversa: | |
print(linalg.inv(matriz)) | |
print('') | |
# Producto por vector: | |
vector = np.matrix([[2], [3], [5]]) | |
print(vector) | |
print(matriz * vector) | |
print('') | |
# Determinante: | |
print(linalg.det(matriz)) | |
print('') | |
# Valores propios: | |
print(linalg.eigvals(matriz)) | |
print('') | |
# Solución de sistemas de ecuaciones: | |
print(linalg.solve(matriz, vector)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment