From bug-request at octave dot org Thu Sep 23 12:27:41 2004 Subject: Re: [OctDev] strcmp problem in interp1 From: "John W. Eaton" To: David Bateman Cc: octave-dev at lists dot sourceforge dot net, bug@octave.org Date: Thu, 23 Sep 2004 13:26:58 -0400 On 23-Sep-2004, David Bateman 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 * 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 at @ -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 ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------