MathGroup Archive 2007

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

Search the Archive

fast way of appending x zeros to a list?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79090] fast way of appending x zeros to a list?
  • From: kristoph <kristophs.post at web.de>
  • Date: Wed, 18 Jul 2007 02:58:56 -0400 (EDT)

Dear all,

I'm looking for a fast way to append 0's to a list. Unfortunately, I
append a variable number of 0's to a list which is generated by a
For[...]-loop. Therefore, PadLeft[...] is not variable enough to
append exactly x zeros to the list.

At the moment I use: Do[PrependTo[data,0],{K}] where the K depends on
certain factors.

In case you have an idea to append exactly x zeros to the left quickly
I would be more that happy since I heard that the PrependTo[...] and
AppendTo[...] functions are very slow.

Thanks a lot.



  • Prev by Date: two integrals
  • Next by Date: Re: N-dimensional NIntegrate
  • Previous by thread: Re: two integrals
  • Next by thread: Re: fast way of appending x zeros to a list?