Write a matlab function that calculates the determinant of a given nxn matrix, either in recursive or iterative form. Do not use the built-in det() function.