help-octave
[Top][All Lists]
Advanced

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

sort question


From: Michael Underwood
Subject: sort question
Date: Wed, 5 May 2004 16:56:58 +1000

I looking for a neat way of determining the index that of each element of an array would have if sorted.
 
eg.
octave:1> a = rand(4,1)
a =
 
  0.73433
  0.55564
  0.49191
  0.90766
 
octave:2> b= sort(a)
b =
 
  0.49191
  0.55564
  0.73433
  0.90766
 
for instance, a(1)  is the 3rd element of b.
 
I know this can be done with the find command, but the array I am dealing with are sufficiently large to make the find command too time consuming.
 
Any ideas??
 
 
Regards
 

reply via email to

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