Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9387
| From | Rodrigo Murta <murta@rodrigomurta.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: ReplacePart, Multiple replacements in one time |
| Date | 2012-04-03 08:54 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jledsa$h4a$1@smc.vnet.net> (permalink) |
| References | <jlbo41$47q$1@smc.vnet.net> |
On Apr 2, 5:30 am, Andrey Demidov <andrey.demi...@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
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
ReplacePart, Multiple replacements in one time Andrey Demidov <andrey.demidov@gmail.com> - 2012-04-02 08:30 +0000 Re: ReplacePart, Multiple replacements in one time nanobio9 <kuokan.liang@gmail.com> - 2012-04-03 08:49 +0000 Re: ReplacePart, Multiple replacements in one time Rodrigo Murta <murta@rodrigomurta.com> - 2012-04-03 08:54 +0000
csiph-web