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: Dieter Schmidt
Subject: [Octave-bug-tracker] [bug #45739] sort 'descend' together with vectors created with the colon operator
Date: Wed, 12 Aug 2015 11:38:11 +0000
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0

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

                 Summary: sort 'descend'  together with vectors created with
the colon operator
                 Project: GNU Octave
            Submitted by: anstreo
            Submitted on: Mi 12 Aug 2015 11:38:11 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: anstreo 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: Microsoft Windows

    _______________________________________________________

Details:

--------------------------------------------------
GNU Octave Version: 4.0.0
GNU Octave License: GNU General Public License
Operating System: MINGW32_NT-6.2 Windows 6.2  i686
--------------------------------------------------

I've used for the first time the 'sort descend' mode together with a
colon-operator created vector, e.g.
>> a=1:3:15;sort(a,'descend')
So the vector a includes the following values:  
[1    4    7   10   13] 
and I would expect with 'sort descend' the following results:
[13   10    7    4    1]

but instead I receive
[15   12    9    6    3]

It seems to be that 'descend' changes the creation of vector 'a' in this way:
a=15:-3:1. Should it really work like this? For my understanding of 'sort' the
result is not correct because the function 'sort' should only sort the values
that are given and should not change the way how the values will be created.
How should I sort a=1:3:15 descendig?

If I'm wrong with my understanding of the sort function, then this special
feature of 'sort descend' should be mentioned in the documentation at least.  
 

greetings





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

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