Checking for singularity of matrix

When doing linear algebra procedures such as
A\b or pinv(A),
where A is a square matrix, is there a way to check for singularity of A ? Otherwise I keep getting errors such as SingularException(3) or LAPACKException(1).

rank

2 Likes