CÓDIGO EN R DEL VÍDEO
### SUMA Y RESTA
## Necesitamos matrices de la misma dimensión
(m <- matrix(1:15, nrow = 5, ncol = 3))
(mm <- rbind(1:3, 3:1, c(1, 1, 1), c(2, 2, 2), c(3, 3, 3)))
#suma
m+mm
#resta
m-mm
## MULTIPLICACION MATRICIAL — se usa el operador %*%
(A <- matrix(1:6, 3, 2)) # 3*2
(B <- rbind(7:9, 10:12)) # 2*3
#3*2 2*3 —3*3
A %*% B
A %*% B
# [,1] [,2] [,3]
#[1,] 47 52 57
#[2,] 64 71 78
#[3,] 81 90 99
#### Recordad en multiplicación matricial no hay propiedad conmutativa
(B <- rbind(7:9, 10:12)) #2*3
(A <- matrix(1:6, 3, 2)) # 3*2
B %*% A
### Inversas -adjunta