Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #9383 > unrolled thread
| Started by | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| First post | 2012-04-03 08:52 +0000 |
| Last post | 2012-04-03 08:52 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: ReplacePart, Multiple replacements in one time Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-04-03 08:52 +0000
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Date | 2012-04-03 08:52 +0000 |
| Subject | Re: ReplacePart, Multiple replacements in one time |
| Message-ID | <jledof$h30$1@smc.vnet.net> |
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]
a = {{1, 2}, {3, 4}}
ReplacePart[a, { {1, 1} -> a[[1, 1]]*2, {1, 2} -> a[[1, 2]] + 5}]
{{1, 2}, {3, 4}}
{{2, 7}, {3, 4}}
?
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web