Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

Re: Simple Question -- Incrementing All Elemnts in A list by 1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44343] Re: [mg44290] Simple Question -- Incrementing All Elemnts in A list by 1
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Wed, 5 Nov 2003 10:02:03 -0500 (EST)
  • References: <200311040824.DAA10546@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I'm afraid you must go back to basics and read again the whole introduction
to the chapter on lists:

In[1]:=
{2, 3, 4, 45, 98} + 1

Out[2]=
{3, 4, 5, 46, 99}

Tomas Garza
Mexico City
----- Original Message ----- 
From: "Thiery Balser" <thiery.balser at gmx.net>
To: mathgroup at smc.vnet.net
Subject: [mg44343] [mg44290] Simple Question -- Incrementing All Elemnts in A list by
1


> Hi,
>
> I'm sort of stuck.
>
> I would like to have all elements in a list incremted by a given number
> without defining a supplementary function.
>
> What I've done so far is:
>
> incFunc[n_]:=n+1;
> Map[incFunc,{2,3,4,45,98}]
>
> which is all fine. It is only that I'm looking for a solution _without_
> defining the mentioned function incFunc.
>
>
> Thanks in advance,
>
> Thiery
>
>
>



  • Prev by Date: Re: Simple Question -- Incrementing All Elemnts in A list by 1
  • Next by Date: Re: Simple Question -- Incrementing All Elemnts in A list by 1
  • Previous by thread: Re: Simple Question -- Incrementing All Elemnts in A list by 1
  • Next by thread: Re: Simple Question -- Incrementing All Elemnts in A list by 1