mat = matrix(c (1,3,2,4,1,3,1,0,1), ncol=3 , nrow=3, byrow=T)
print(mat)
## [,1] [,2] [,3]
## [1,] 1 3 2
## [2,] 4 1 3
## [3,] 1 0 1
Determinant of the above matrix can be calculated as below
Verify using R
r print(det(mat))
## [1] -4