# HG changeset patch # User jwe # Date 745272556 0 # Node ID 2d10ab3ee69d61a1bc1bd3f5813d864721ba2905 # Parent e96cf7e437508df2b2055ef5a00c32ecdf5621b4 [project @ 1993-08-13 20:09:16 by jwe] Initial revision diff -r e96cf7e43750 -r 2d10ab3ee69d scripts/general/is_symmetric.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/general/is_symmetric.m Fri Aug 13 20:09:16 1993 +0000 @@ -0,0 +1,23 @@ +function retval = is_symmetric (x,tol) + +# usage: is_symmetric (x{,tol}) +# +# If x is symmetric, return the dimension of x, otherwise, return 0. +# +# See also: size, rows, columns, length, is_matrix, is_scalar, +# is_square, is_vector + + if (nargin == 1 || nargin == 2) + if ((retval = is_square (x))) + if (nargin == 1) + tol = eps; + endif + if (norm (x - x') / norm(x) > tol) + retval = 0; + endif + endif + else + error ("usage: is_symmetric (x {,tol})"); + endif + +endfunction