# HG changeset patch # User Jaroslav Hajek # Date 1265783393 -3600 # Node ID fc879f361bdab5b13bb278360c78db705c529969 # Parent 1756b3035282f7fbbbd4a524972a5d1eb42afed0 make isreal matlab compatible diff -r 1756b3035282 -r fc879f361bda src/ChangeLog --- a/src/ChangeLog Wed Feb 10 07:07:00 2010 +0100 +++ b/src/ChangeLog Wed Feb 10 07:29:53 2010 +0100 @@ -1,3 +1,9 @@ +2010-02-10 Jaroslav Hajek + + * ov-str-mat.h (octave_char_matrix_str::is_real_type): Delete + overload. + * data.cc (Fisreal): Improve docs. + 2010-02-10 Jaroslav Hajek * data.cc (Fisnumeric): Improve documentation. diff -r 1756b3035282 -r fc879f361bda src/DLD-FUNCTIONS/cellfun.cc --- a/src/DLD-FUNCTIONS/cellfun.cc Wed Feb 10 07:07:00 2010 +0100 +++ b/src/DLD-FUNCTIONS/cellfun.cc Wed Feb 10 07:29:53 2010 +0100 @@ -777,8 +777,8 @@ %% First input argument can be the special string "isreal", %% "isempty", "islogical", "length", "ndims" or "prodofsize" %!test -%! A = cellfun ("isreal", {true, 0.1, false, i*2, [], "abc"}); -%! assert (A, [true, true, true, false, true, false]); +%! A = cellfun ("isreal", {true, 0.1, {}, i*2, [], "abc"}); +%! assert (A, [true, true, false, false, true, true]); %!test %! A = cellfun ("isempty", {true, 0.1, false, i*2, [], "abc"}); %! assert (A, [false, false, false, false, true, false]); diff -r 1756b3035282 -r fc879f361bda src/data.cc --- a/src/data.cc Wed Feb 10 07:07:00 2010 +0100 +++ b/src/data.cc Wed Feb 10 07:29:53 2010 +0100 @@ -3277,7 +3277,9 @@ DEFUN (isreal, args, , "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} isreal (@var{x})\n\ -Return true if @var{x} is a real-valued numeric object.\n\ +Return true if @var{x} is a non-complex matrix or scalar.\n\ +For compatibility with Matlab, this includes logical and character\n\ +matrices.\n\ @end deftypefn") { octave_value retval; diff -r 1756b3035282 -r fc879f361bda src/ov-str-mat.h --- a/src/ov-str-mat.h Wed Feb 10 07:07:00 2010 +0100 +++ b/src/ov-str-mat.h Wed Feb 10 07:29:53 2010 +0100 @@ -107,8 +107,6 @@ bool is_string (void) const { return true; } - bool is_real_type (void) const { return false; } - bool is_numeric_type (void) const { return false; } double double_value (bool = false) const;