Re: My first program: sublime (reverse of "extract" function)

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu