MathGroup Archive 2009

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

Search the Archive

Re: Modifying List Elements.


Hi,

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

with:

{0, 0.5 } + # & /@ data

or

data /. {a_?NumericQ, b_?NumericQ} :> {a, b + 0.5}

or

ReplacePart[#, 2 -> #[[2]] + 0.5] & /@ data

Regards
   Jens


nick.maj at mssm.edu wrote:
> 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: Looking for more Mathematica online user groups/forums
  • Next by Date: Re: converting binary data
  • Previous by thread: Modifying List Elements.
  • Next by thread: Re: Modifying List Elements.