ISREAL True for matrix that contains only real elements. ISREAL(X) returns 1 if all elements in X have zero imaginary part.
0001 function t = isreal(x) 0002 %ISREAL True for matrix that contains only real elements. 0003 % ISREAL(X) returns 1 if all elements in X have zero 0004 % imaginary part. 0005 0006 % Clay M. Thompson 10-9-92 0007 % Copyright (c) 1992 by The MathWorks, Inc. 0008 % $Revision: 1.4 $ $Date: 1993/09/09 19:36:19 $ 0009 0010 t = all(all(imag(x)==0)); 0011