With the definition of the determinant, you can reformulate the problem as finding the roots of an nth polynomial. Either do it by hand (easy for the 3×3 case) or use the symbolic math toolbox to do it. Then you can use the MATLAB roots
function to solve it.