MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

generalized foldlist problem


DearAll,

Please, help!

I have two list

list1={a,b,c,d,e}
list2={3,2,5,1,6}

and I want to apply a modified version of FoldList to list1 in the
following way: list2 indicates that element a appears only 3 times (if
space enough) beginning from the beginning of the list , element b
appears 2 times, c - 5 times , etc.

So the output should be

GeneralizedFoldList[list1,list2]={a,a+b,a+b+c,c+d,c+e}

Thanks for any hints,

arek


  • Prev by Date: Re: Hadamard -Sylvester Matrix Self-Similarity by substitution and reparatitioning
  • Next by Date: Re: NonlinearRegress with weight
  • Previous by thread: CatchMachineUnderflow
  • Next by thread: Re: generalized foldlist problem