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

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

[Octave-bug-tracker] [bug #61750] ismember does not report all matches


From: Liang Tang
Subject: [Octave-bug-tracker] [bug #61750] ismember does not report all matches
Date: Fri, 31 Dec 2021 16:58:08 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

URL:
  <https://savannah.gnu.org/bugs/?61750>

                 Summary: ismember does not report all matches
                 Project: GNU Octave
            Submitted by: lt1234
            Submitted on: Fri 31 Dec 2021 09:58:06 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: lt1234
        Originator Email: 
             Open/Closed: Open
                 Release: 6.3.0
         Discussion Lock: Any
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

The ismember document has this below:  (the emphasis is "each")  

If a second output argument is requested then the index into S of each
matching element is also returned.

I am not sure "each" applies to A or S, or both.  The documentation did not
limit the element of S to be unique.   

Two cases are tried: 

>> [a,b]=ismember({'1'}, {'1', '2'})
a = 1
b = 1

>>  [c,d]=ismember({'1'}, {'1', '2', '1'})
c = 1
d = 3

Based on Octave documentation, I expect d = [1 3]. 

>From an example of mathworks on-line help, matlab returns the first match. 
For the test above, d should be 1.       

Thanks.  





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61750>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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