MathGroup Archive 2007

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

Search the Archive

RE: making a list using table but with different increment after a certain number


Three ways

1)  Join[Table[a, {a, 0, 9, 1}], Table[a, {a, 10, 100, 10}]]

2)  Join[Range[0, 9], Range[10, 100, 10]]

3)  Module[{a, alist}, a = 0; alist = {}; 
 While[a <= 100, alist = Append[alist, a]; 
  a = a + If[a < 10, 1, 10]]; alist]

Best regards

Ingolf Dahl
Sweden

-----Original Message-----
From: sean_incali [mailto:sean_incali at yahoo.com] 
Sent: 24 September 2007 10:22
To: mathgroup at smc.vnet.net
Subject: [mg81539] [mg81469] making a list using table but with different increment
after a certain number

I can make a list using

Table[a, {a, 0, 100, 10}]

gives

{0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}


But let's say I wanted to make a list that increment in 1 up to 10, then
increment in 10 onwards.

So that after "tabling" I would get...

{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}

How do I accomplish this?






  • Prev by Date: Re: Nullcline and getting "2" values for y
  • Next by Date: Re: Still More Stylesheet Questions
  • Previous by thread: Re: making a list using table but with different increment after a certain number
  • Next by thread: Re: making a list using table but with different increment after a certain number