From: John W. E. <jw...@be...> - 2004-09-23 17:28:01
|
On 23-Sep-2004, David Bateman <Dav...@mo...> wrote: | Ok, I take it back... Its not a bug in octave-forge, but should be | considered a bug in 2.1.59 as in matlab R12 I get | | strcmp(NaN, 'test') | | ans = | | 0 | | >> strcmp(1,1) | | ans = | | 0 | | | So numeric arguments are acceptable to matlab and always return | false... How about the following change then? jwe scripts/ChangeLog: 2004-09-23 John W. Eaton <jw...@oc...> * strings/strcmp.m: If args are not strings or cell arrays of strings, return zero instead of reporting an error. Index: scripts/strings/strcmp.m =================================================================== RCS file: /usr/local/cvsroot/octave/scripts/strings/strcmp.m,v retrieving revision 1.24 diff -u -r1.24 strcmp.m --- a/scripts/strings/strcmp.m 15 Sep 2004 18:28:56 -0000 1.24 +++ b/scripts/strings/strcmp.m 23 Sep 2004 17:25:20 -0000 @@ -139,11 +139,7 @@ else error ("strcmp: nonconformant cell arrays"); endif - else - error ("strcmp: expecting args to be strings or cell arrays of strings"); endif - else - error ("strcmp: expecting args to be strings or cell arrays of strings"); endif endfunction |