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

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

[Octave-bug-tracker] [bug #45739] sort 'descend' together with vectors c


From: Michael Godfrey
Subject: [Octave-bug-tracker] [bug #45739] sort 'descend' together with vectors created with the colon operator
Date: Wed, 12 Aug 2015 13:16:43 +0000
User-agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2478.0 Safari/537.36

Follow-up Comment #3, bug #45739 (project octave):

a = 1:2:10  is a range,
>> typeinfo(a)
ans = range
>> whos
Variables in the current scope:

   Attr Name        Size                     Bytes  Class
   ==== ====        ====                     =====  ===== 
        a           1x5                         24  double


It is not a matrix. So, it appears
that sort is converting the range in a way that is
counter intuitive.


Matlab treats a = 1:2:10 as the matrix
a =

     1     3     5     7     9

>> whos
  Name      Size            Bytes  Class     Attributes

  a         1x5                40  double 

Matlab does not implement type range.  

So, one solution would  modify sort to convert range to
matrix (a = [a];).

About the priority this needs, I doubt if many users provide
range variables to sort. But, it should be fixed, especially
for matlab compatibility.   
       


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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