MathGroup Archive 2012

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

Search the Archive

Re: ReplacePart, Multiple replacements in one time


On Apr 2, 5:30 am, Andrey Demidov <andrey.demi... at gmail.com> wrote:
> I'm just wondering if it is possible to make n different replacements in one command?
>
> Something like this:
>
>
>
>
>
>
>
> >> a = {{1, 2}, {3, 4}}
> >> ReplacePart[a, 1 -> a[[1]] * 2, 2 -> a[[2]] + 5]

Maybe like this?

ReplacePart[a, {1 -> a[[1]]*2, 2 -> a[[2]] + 5}]

best regards
Murta



  • Prev by Date: Re: ReplacePart, Multiple replacements in one time
  • Next by Date: Defining a value-specific ColorFunction for use in ListDensityPlot
  • Previous by thread: Re: ReplacePart, Multiple replacements in one time
  • Next by thread: Re: ReplacePart, Multiple replacements in one time