A=log(rand(3,3)); /// @@prerequisite if imag(A)==0 then disp('A is a real matrix '); else disp('A is complex'); end