bugGNU Octave - Bugs: bug #33531, ismember Matlab compatibility issue

 
 

bug #33531: ismember Matlab compatibility issue

Submitter:  Arnaud Delorme <arnodelorme>
Submitted:  Sat 11 Jun 2011 03:35:43 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.4.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Sep 2011 05:11:03 AM UTC, comment #4: 

Fixed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/e8c52b442a99).  Reporter will need to build from development sources or wait until version 3.6 to see the change.

Rik <rik5>
Group administrator
Wed 27 Jul 2011 10:57:49 PM UTC, comment #3: 

This is what Matlab returns

ismember (2 < 3, int8 ([0, 1]))
ans =

     1

ismember (1, int8 ([0, 1]))
ans =

     1

ismember (int16 (1), int8 ([0, 1]))
ans =

     1

Octave 3.4.0 return an error for the first command and returns 1 for the two other ones.

Arnaud Delorme <arnodelorme>
Wed 27 Jul 2011 02:07:48 PM UTC, comment #2: 

No response to request for information in 1 month.  Closing issue report.  It may be re-opened.

Rik <rik5>
Group administrator
Sun 12 Jun 2011 07:39:59 PM UTC, comment #1: 

The Matlab docs don't seem to say anything about the arguments to ismember being logical, but if that is allowed, why should logical values be converted to numeric values?

What are the rules for comparison here?  Does class have to match exactly, or are there some loose and undocumented conversion rules at work?  For example, what happens for


ismember (2 < 3, int8 ([0, 1]))
ismember (1, int8 ([0, 1]))
ismember (int16 (1), int8 ([0, 1]))


?

John W. Eaton <jwe>
Group administrator
Sat 11 Jun 2011 03:35:43 PM UTC, original submission:  

ismember does not convert logical value to numerical values when necessary

ismember([0 1], [0 1]); % OK 

ismember(2 < 3, [0 1]); % crashes (Matlab OK)

Arnaud Delorme <arnodelorme>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by arnodelorme (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-26 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2011-07-28 rik5 Open/ClosedClosed Open
    2011-07-27 rik5 Open/ClosedOpen Closed
    2011-06-12 jwe StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code