bugGNU Octave - Bugs: bug #49601, strmatch, incompatible result on...

 
 

bug #49601: strmatch, incompatible result on 'empty' input, (and still around in 2016b)

Submitted by:  Nicholas Jankowski <nrjank>
Submitted on:  Mon 14 Nov 2016 03:16:06 PM UTC  
 
Category:  Octave Function Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Nicholas Jankowski Open/Closed:  Closed
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Thu 24 Nov 2016 12:42:25 PM UTC, comment #7:

I came across a similar compatibility issue with Matlab:

Octave:

Matlab:

Guillaume <gyom>
Sun 20 Nov 2016 06:57:24 PM UTC, comment #6:

I went ahead and pushed the changeset to the development branch of Octave. Closing report.

Rik <rik5>
Project Administrator
Tue 15 Nov 2016 04:48:14 AM UTC, comment #5:

Try the attached cset. It matches the behavior that you documented in comment #4 for empty whitespace input.

(file #38969)

Rik <rik5>
Project Administrator
Mon 14 Nov 2016 04:53:39 PM UTC, comment #4:

oops, bad tag:

looking at the original case:

Nicholas Jankowski <nrjank>
Mon 14 Nov 2016 04:52:42 PM UTC, comment #3:

looking at the original case:

>> strmatch(' ', ' ')

ans =
1

>> strmatch(' ', ' ')

ans =
1

>> strmatch(' ', ' ')

ans =
1

>> strmatch(' ', ' ')

ans =
[]

>> strmatch(' ', ' ')

ans =
1

>> strmatch(' ', ' ')

ans =
[]

Nicholas Jankowski <nrjank>
Mon 14 Nov 2016 04:46:24 PM UTC, comment #2:

methinks this is going to me another case of teasing out a sensible ruleset... I'm still at a loss

more matlab output:

Nicholas Jankowski <nrjank>
Mon 14 Nov 2016 03:24:02 PM UTC, comment #1:

Matlab:

Octave:

(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)

Nicholas Jankowski <nrjank>
Mon 14 Nov 2016 03:16:06 PM UTC, original submission:

This was just brought up over at stackoverflow:
http://stackoverflow.com/questions/40565761/octave-issue-runnig-matlab-file-at-if-x-0-strmatchxx

in Matlab 2016b:

Octave 4.0.3:

since the function is supposed to trim trailing whitespace, it appears Octave deals with it as comparing empty inputs, producing empty outputs, while Matlab does not.

Compatibility on handling empty inputs seems to have popped up a few places. I realize this function has been on the 'will be deprecated list' for quite a few years now, but it seems Matlab has been keeping it around so compatibility fixes still make sense. especially if a fix isn't overly complicated

Are there any other similar functions we should check for similar behavior?

Nicholas Jankowski <nrjank>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #38969:  bug49601.cset added by rik5 (2KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gyom (Posted a comment)
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by nrjank (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-20 rik5 StatusPatch Submitted => Fixed
        Open/ClosedOpen => Closed
        Release4.0.3 => dev
        Operating SystemMicrosoft Windows => Any
    2016-11-15 rik5 Attached File- => Added bug49601.cset, #38969
        Severity3 - Normal => 2 - Minor
        StatusNone => Patch Submitted

    Back to the top


    Powered by Savane 3.4