Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonatanpineda/1550f759a7e56d30492440888e3d38c5 to your computer and use it in GitHub Desktop.
Save jonatanpineda/1550f759a7e56d30492440888e3d38c5 to your computer and use it in GitHub Desktop.
4. Métodos multivariados
#### Ejercicio 1. Realice las operaciones que se indican
A <- matrix(c(4,-5,6,1,0,-9,7,-14,2),nrow=3,ncol=3,byrow = TRUE)
B <- matrix(c(18,17,11,19,13,6,6,14,9),nrow=3,ncol=3,byrow = TRUE)
M <- matrix(c(7,-1,11,8,-7,21),nrow=3,ncol=2,byrow = TRUE)
N <- matrix(c(9,-1,11,-9,-6,5),nrow=3,ncol=2,byrow = TRUE)
#Ejemplo multiplicación
A %*% B
#Ejemplo Transpuesta
t(M)
#### Ejercicio 2. Dadas las matrices A y B determine AB.
A <- fractions(matrix(c(5/2,1/2,-1,2/3,1/3,-1/2,1,4/3,-2),nrow=3,ncol=3,byrow=TRUE))
B <- fractions(matrix(c(0,12/5,-3/5,-6,144/5,-21/5,-4,102/5,-18/5),nrow=3,ncol=3,byrow=TRUE))
# inciso a
fractions(A %*% B)
# inciso b: Es una matriz de identidad
# inciso c: La matriz B es inversa de A
#### Ejercicio 3.
A <- matrix(c(1,1,3,4),nrow=2,ncol=2,byrow=TRUE)
B <- matrix(c(2,1,1,1),nrow=2,ncol=2,byrow=TRUE)
C <- matrix(c(1,2,1,3),nrow=2,ncol=2,byrow=TRUE)
#Determine la matriz X de la siguiente expresión X = (2C-B)/A
fractions(((2*C)-B)/A)
#### Ejercicio 4.
A = "Matriz diagonal"
B = "Matriz cuadrada"
C = "Matriz identidad"
D = "Matriz nula"
E = "Matriz Triangular"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment