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: Nicholas Jankowski
Subject: [Octave-bug-tracker] [bug #61750] ismember does not report all matches
Date: Sat, 1 Jan 2022 11:51:20 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36

Follow-up Comment #2, bug #61750 (project octave):

what you're seeing is in part an input ordering issue. you're asking where are
elements of input #2 in input #1:

matlab 2021b:

>> [a,b]=ismember({'1'}, {'1', '2'})
a =
  logical
   1
b =
     1
>>  [c,d]=ismember({'1'}, {'1', '2', '1'})
c =
  logical
   1
d =
     1
>> [a,b]=ismember({'1', '2'}, {'1'})
a =
  1×2 logical array
   1   0
b =
     1     0
>> [c,d]=ismember({'1', '2', '1'}, {'1'})
c =
  1×3 logical array
   1   0   1
d =
     1     0     1


Octave 7.0.1 (hg id: 366aa563dd2e) matches all of the above except 

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


the shape is correct, but it's matching the last instead of first instance,
which should be fixed.


    _______________________________________________________

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]