Mercurial > hg > octave-lyh
diff scripts/general/issquare.m @ 10023:73fc43e01f4c
allow issquare on arbitrary data
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 25 Dec 2009 22:20:33 +0100 |
parents | 1c274aa2b4d1 |
children | 0d9640d755b1 |
line wrap: on
line diff
--- a/scripts/general/issquare.m +++ b/scripts/general/issquare.m @@ -30,7 +30,7 @@ function retval = issquare (x) if (nargin == 1) - if (ismatrix (x) && ndims (x) == 2) + if (ndims (x) == 2) [r, c] = size (x); retval = r == c; else @@ -51,16 +51,16 @@ %!assert(issquare ([1, 2; 3, 4])); %!test -%! assert(!(issquare ("t"))); +%! assert(issquare ("t")); %!assert(!(issquare ("test"))); %!test -%! assert(!(issquare (["test"; "ing"; "1"; "2"]))); +%! assert(issquare (["test"; "ing"; "1"; "2"])); %!test %! s.a = 1; -%! assert(!(issquare (s))); +%! assert(issquare (s)); %!assert(!(issquare ([1, 2; 3, 4; 5, 6])));