octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49601] strmatch, incompatible result on 'empt


From: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #49601] strmatch, incompatible result on 'empty' input, (and still around in 2016b)
Date: Mon, 14 Nov 2016 15:24:02 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0

Follow-up Comment #1, bug #49601 (project octave):

Matlab:

>> strmatch([],[])
ans =
     1
>> strmatch(ones(0,1),ones(0,1))
ans =
  0×1 empty double column vector
>> strmatch(ones(0,1,0,0),ones(0,1))
ans =
  0×1 empty double column vector
>> strmatch(ones(0,1,0,0),ones(0,1,0,1))
ans =
     1


Octave:


>> strmatch([],[])
error: strmatch: S must be a string
error: called from
    strmatch at line 64 column 5


(same results for the other empty input versions)


Also, matlab does still recommend not using strmatch, and recommends
validatestring (which Octave has) or startsWith (apparently new in 2016b, so
Octave doesn't have a compatible implementation yet) 

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49601>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]