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

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

[Octave-bug-tracker] [bug #36221] using ~ as optional output for unique


From: John Hunt
Subject: [Octave-bug-tracker] [bug #36221] using ~ as optional output for unique causes error in ismember
Date: Wed, 18 Apr 2012 14:59:28 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0

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

this bug is not limited to unique, see #36240

meanwhile you can just avoid trailing ~
(beware that once unique has been called with a trailing ~,
clear unique is mandatory for it to work again)

output from 56 to 60 : same as yours
output from 61 to 64 : works


octave:56> A = [1 2];
octave:57> s = [1 2; 3 4; 5 6];
octave:58> [xx, ii, jj] = unique ([A; s], "rows", "last")
xx =

   1   2
   3   4
   5   6

ii =

   2
   3
   4

jj =

   1
   1
   2
   3

octave:59> [a, b, ~] = unique ([1, 2, 3, 2, 1, 6, 4]); 
octave:60> [xx, ii, jj] = unique ([A; s], "rows", "last")
xx =

   1   2
   3   4
   5   6

ii =

   2
   3
   4

jj = [](0x0)
octave:61> clear unique
octave:62> [xx, ii, jj] = unique ([A; s], "rows", "last")
xx =

   1   2
   3   4
   5   6

ii =

   2
   3
   4

jj =

   1
   1
   2
   3

octave:63> [a, b] = unique ([1, 2, 3, 2, 1, 6, 4]); 
octave:64> [xx, ii, jj] = unique ([A; s], "rows", "last")
xx =

   1   2
   3   4
   5   6

ii =

   2
   3
   4

jj =

   1
   1
   2
   3




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?36221>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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