bugGNU Octave - Bugs: bug #59389, comparison of double-quoted...

 
 

bug #59389: comparison of double-quoted strings is different than matlab

Submitted by:  Alois Schlögl <schloegl>
Submitted on:  Sun 01 Nov 2020 11:28:25 AM UTC  
 
Category:  Interpreter Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  Duplicate Assigned to:  None
Originator Name:  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.

 

Tue 03 Nov 2020 07:41:26 AM UTC, comment #4: 

Thanks, Guillaume. For some reason, I couldn't find that bug report.

Reverting to the original title and closing as a duplicate of bug #50855.

Markus Mützel <mmuetzel>
Project Member
Mon 02 Nov 2020 10:30:24 PM UTC, comment #3: 

There is already an open bug #50855 for the string class. I also noticed this blog entry by @apjanke:
http://blog.apjanke.net/2019/04/20/matlab-string-representation-is-a-mess.html
I don't use the string class in Matlab but its use seems to be more and more pervasive so I wonder if it could be one of the goals for the next release - apart from the "..." compatibility, I don't have a good feel for how much work would be required.

Guillaume <gyom>
Mon 02 Nov 2020 07:21:48 PM UTC, comment #2: 

This is a known difference between Octave and Matlab and has been this way for many years.  Eventually Octave may implement a string class, but it will require re-architecting core pieces of Octave and this is hard work.

Rik <rik5>
Project Administrator
Sun 01 Nov 2020 12:12:34 PM UTC, comment #1: 

Octave does not currently support a string class. Double-quoted strings have a different meaning.
See also this mailing list thread from late 2017:
https://lists.gnu.org/archive/html/octave-maintainers/2017-12/msg00115.html

I didn't find a bug report for this feature request. So maybe this report could stand in for one.

Markus Mützel <mmuetzel>
Project Member
Sun 01 Nov 2020 11:28:25 AM UTC, original submission:  

The result of this code is different

a="BALL";
b="BELL";

a>b
a<b
a==b

The output on Matlab R2020a is

>> a>b
ans =
  logical
   0
>> a<b
ans =
  logical
   1
>> a==b
ans =
  logical
   0

The output on octave (4.4.1, 5.2.0, 6.0.0 (compiled from source on 2020-03-26) is 

octave:3> a>b
ans =

  0  0  0  0

octave:4> a<b
ans =

  0  1  0  0

octave:5> a==b
ans =

  1  0  1  1

When single-quoted strings are used in Matlab, the behaviour is the same as in Octave.

Alois Schlögl <schloegl>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

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 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by schloegl (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 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-11-03 mmuetzel StatusConfirmed => Duplicate
        Open/ClosedOpen => Closed
        SummaryImplement Matlab compatible string class => comparison of double-quoted strings is different than matlab
        Dependencies- => Depends on bugs #50855
    2020-11-02 rik5 Severity3 - Normal => 1 - Wish
    2020-11-01 mmuetzel CategoryNone => Interpreter
        Item GroupMatlab Compatibility => Feature Request
        StatusNone => Confirmed
        Release5.2.0 => dev
        Operating SystemGNU/Linux => Any
        Summarycomparison of double-quoted strings is different than matlab => Implement Matlab compatible string class

    Back to the top


    Powered by Savane 3.7