A <- matrix(c(-2, 4, -5, -1, -1, 1, -5, 0, -3), nrow = 3, ncol = 3)
det(A)
## [1] -13
B <- matrix(c(0, -3, 0, 2, -1, 0, 5, 4, -1), nrow = 3, ncol = 3)
det(B)
## [1] -6
C <- matrix(c(-3, -3, 1, 0, 0, 3, 3, 1, 0, 0, 1, -5, 0, 0, 0, 2), nrow = 4, ncol = 4)
det(C)
## [1] -18
Yoshida.Ruriko.2021.Linear Algebra and Its Applications With R.London. CRC Press