MathGroup Archive 2002

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

Search the Archive

Re: more elements in a list


merkat wrote:

> Hi ,
>
> How do I multiply the number of elements in a list?
> I have the lists:
> {a,b,c}  and
> {2,5,4}
>
> the result should be:
> {a,a,b,b,b,b,b,c,c,c,c}
>
> Merkat

You could use

mult[a_,b_]:=Flatten[Table[#[[1]],{#[[2]]}]&/@Transpose[{a,b}]]

Ssezi



  • Prev by Date: Re: ORDINARY DIFFERENTIAL EQUATION
  • Next by Date: Re: more elements in a list
  • Previous by thread: more elements in a list
  • Next by thread: Re: more elements in a list