sortrows problem

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

sortrows problem

shivax
This post was updated on .
hi,

i see this link :
https://octave.sourceforge.io/octave/function/sortrows.html

it says;
By default (c omitted, or a particular column unspecified in c) an ascending sort order is used

look this matrix:


 a=[2 3 4 1]

f=sortrows(a)
f =

   2   3   4   1

f=sortrows(a,-1)
f =

   2   3   4   1


i don't see any difference...

i want ascending order and not





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: sortrows problem

mmuetzel
Your input matrix consists of only one row. So sorting order doesn't really
matter.
Maybe you are looking for "sort"?
https://octave.sourceforge.io/octave/function/sort.html

Markus



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: sortrows problem

shivax
Hi

I looking for the opposite of short...i dont find it



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: sortrows problem

shivax
excuse me

i can to find it with the following method:

 a=[2 3 4 1]

b=short(a)


the value is : b(end)






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html