To calculate the determinant Matlab doesn't use an analytical formula but to calculate it in a simpler way, first it passes from the LU factorization which is susceptible to floating-point round-off errors (Limitations and Algorithms of function det).
The LU factorization allows to write the matrix A as the product of two matrices (L, U) where L is lower triangular and U is upper triangular.
in this way it is easier calculate the determinant because L and U are triangular.
If you want to verify that the matrix A is singular you can use the condition number (cond) and if it assumes very high values it means that the matrix is "close" to the singularity.
Otherwise, if you need to invert the matrix A you can use the operator "\" which uses more efficient methods (you could reading about it in this answer) .