Autores
-Rene Avila
-Michael Chacaguasay
-Johann Tul
-Bryan Venegas
A<-c(1,2,3,4,2,4,6,8,3,6,9,12)
dim(A)<-c(4,3)
A
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 2 4 6
## [3,] 3 6 9
## [4,] 4 8 12
i<-diag(1,4,4)
i
## [,1] [,2] [,3] [,4]
## [1,] 1 0 0 0
## [2,] 0 1 0 0
## [3,] 0 0 1 0
## [4,] 0 0 0 1
l<-matrix(c(1,-1,2,2,-1,7,-4,5,-3))
dim(l)<-c(3,3)
l
## [,1] [,2] [,3]
## [1,] 1 2 -4
## [2,] -1 -1 5
## [3,] 2 7 -3
library(matlib)
## Warning: package 'matlib' was built under R version 4.1.3
Inverse(l,verbose=FALSE,fractions=TRUE,latex=TRUE)
## [,1] [,2] [,3]
## [1,] -16.0 -11.0 3.0
## [2,] 3.5 2.5 -0.5
## [3,] -2.5 -1.5 0.5
#p<-as.matrix(Matriz)
#p
d<-matrix(c(1,-2,5,-7),ncol = 2,nrow = 2)
d
## [,1] [,2]
## [1,] 1 5
## [2,] -2 -7
b<-c(7,-5)
showEqn(d,b)
## 1*x1 + 5*x2 = 7
## -2*x1 - 7*x2 = -5
d<-matrix(c(1,-2,5,-7),ncol = 2, nrow = 2)
b<-c(7,5)
library(matlib)
Solve(d,b,verbose=TRUE,fractions = TRUE)
##
## Initial matrix:
## [,1] [,2] [,3]
## [1,] 1 5 7
## [2,] -2 -7 5
##
## row: 1
##
## exchange rows 1 and 2
## [,1] [,2] [,3]
## [1,] -2 -7 5
## [2,] 1 5 7
##
## multiply row 1 by -1/2
## [,1] [,2] [,3]
## [1,] 1 7/2 -5/2
## [2,] 1 5 7
##
## subtract row 1 from row 2
## [,1] [,2] [,3]
## [1,] 1 7/2 -5/2
## [2,] 0 3/2 19/2
##
## row: 2
##
## multiply row 2 by 2/3
## [,1] [,2] [,3]
## [1,] 1 7/2 -5/2
## [2,] 0 1 19/3
##
## multiply row 2 by 7/2 and subtract from row 1
## [,1] [,2] [,3]
## [1,] 1 0 -74/3
## [2,] 0 1 19/3
## x1 = -74/3
## x2 = 19/3
a<-matrix(c(1,7,6,4,2,8,9,5,3),ncol = 3,nrow = 3)
a
## [,1] [,2] [,3]
## [1,] 1 4 9
## [2,] 7 2 5
## [3,] 6 8 3
Det=(minor(a,1,1)
-minor(a,1,2)
+2*minor(a,1,3))
det(a)
## [1] 398
a<-matrix(c(1,4,7,2,5,8,3,6,9),3,3)
a
## [,1] [,2] [,3]
## [1,] 1 2 3
## [2,] 4 5 6
## [3,] 7 8 9
e<-t(a)
e
## [,1] [,2] [,3]
## [1,] 1 4 7
## [2,] 2 5 8
## [3,] 3 6 9