x = input("Enter Matrix value:") [m, n] = size(x) if m == n then if detr(x) == 0 disp("Inverse does not exist") else a = inv(x) disp("Determinant is: ", detr(x)) disp("Inverse is: ", a) end else disp("Matrix is not square.") end