MathGroup Archive 2009

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

Search the Archive

Re: Modifying List Elements.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98973] Re: [mg98948] Modifying List Elements.
  • From: "David Park" <djmpark at comcast.net>
  • Date: Thu, 23 Apr 2009 06:41:13 -0400 (EDT)
  • References: <13008985.1240391807407.JavaMail.root@n11>

data = {{0, 1}, {1, 2}};

# + {0, 0.5} & /@ data
{{0, 1.5}, {1, 2.5}}

That's a pure Function, which you can find out about by looking up Function
in Help, if you are not already familiar with it. And /@ is Map.

David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  


From: nick.maj at mssm.edu [mailto:nick.maj at mssm.edu] 


how can i add a value to an element in lists?

data:
{{0,1},{1,2}}

needed output:
{{0,1.5},{1,2.5}}

thanks in advance, nick.




  • Prev by Date: Re: pure function with optional number of arguments
  • Next by Date: Re: fit a complex function
  • Previous by thread: Re: Modifying List Elements.
  • Next by thread: How to get values from Manipulate