Thu 24 Nov 2016 12:42:25 PM UTC, comment #7:
I came across a similar compatibility issue with Matlab:
Octave:
Matlab:
|
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.
|
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)
|
Mon 14 Nov 2016 04:53:39 PM UTC, comment #4:
oops, bad tag:
looking at the original case:
|
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 =
[]
|
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:
|
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)
|
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?
|