Page 1 of 1

Ordered Subscripts

Posted: Tue Mar 16, 2004 10:01 am
by pochoa
I need to order the elements on a vector from smallest to biggest. I know I can use Vector Sort Order for doing it, but after reordening I need to use each of the elements in a different equation and I don't know how to do it, I don't know how to call the first or the third or the last element on the reordered vector.
Thanks for your help.

Posted: Tue Mar 16, 2004 10:30 am
by Administrator
The way to do this is to loop through the sorted array.

eg to get element n,

sum (
if then else ( sorted array[subsc!] = n
, sorted array[subsc!]
, 0 )
)

This loops through the array, and will pick out only the element that has the n.

Hope this helps.

Tony.