Re: My first program: sublime (reverse of "extract" function)
- Posted by petelomax May 21, 2013
- 2283 views
Bit late joining in, but I would have started with a tag sort:
sequence InputData = {0.01, 0.05, 0.08, 0.03, 0.02} sequence tags = tag_sort(InputData) -- {1,5,4,2,3}
then you could do something like:
for i=2 to length(tags) do InputData(tags[i]) *= 1-InputData(tags[i-1]) end for
which should give the required results
Regards, Pete