Re: making a list using table but with different increment after a certain number
- To: mathgroup at smc.vnet.net
- Subject: [mg81508] Re: making a list using table but with different increment after a certain number
- From: Norbert Marxer <marxer at mec.li>
- Date: Wed, 26 Sep 2007 06:41:25 -0400 (EDT)
- References: <fd7sae$cgl$1@smc.vnet.net>
On 24 Sep., 10:25, sean_incali <sean_inc... at yahoo.com> wrote:
> 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?
Hello
There are many ways to do what you want: e.g.
{Table[i, {i, 0, 10}], Table[i, {i, 20, 100, 10}]} // Flatten
{Range[10] - 1, 10 Range[10]} // Flatten
li = {}; Do[ If[i < 11, AppendTo[li, i - 1], AppendTo[li, 10 (i -
10)]], {i, 20}]; li
Best Regards
Norbert Marxer