Mercurial > hg > octave-nkf
changeset 10023:73fc43e01f4c
allow issquare on arbitrary data
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 25 Dec 2009 22:20:33 +0100 |
parents | a14dc255427f |
children | 184060864627 |
files | scripts/ChangeLog scripts/general/issquare.m scripts/linear-algebra/ishermitian.m scripts/linear-algebra/issymmetric.m |
diffstat | 4 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2009-12-25 Jaroslav Hajek <highegg@gmail.com> + + * general/issquare.m: Do not check type. + * linear-algebra/issymmetric.m: Strengthen test. + * linear-algebra/ishermitian.m: Strengthen test. + 2009-12-25 Jaroslav Hajek <highegg@gmail.com> * strings/strfind.m: Remove.
--- 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])));