Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10792 > unrolled thread
| Started by | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| First post | 2012-07-05 10:11 +0000 |
| Last post | 2012-07-05 10:11 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Modifying an entry in array specified by a list of arbitrary length Bill Rowe <readnews@sbcglobal.net> - 2012-07-05 10:11 +0000
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Date | 2012-07-05 10:11 +0000 |
| Subject | Re: Modifying an entry in array specified by a list of arbitrary length |
| Message-ID | <jt3p86$102$1@smc.vnet.net> |
On 7/4/12 at 3:32 AM, samid.hoda@gmail.com wrote:
>I want to edit an element whose position is specified by an
>arbitrary list that is a result of a computation (the list is not of
>fixed length). Something like
>i = {1,2,3} Extract[X,i]+=1
>except that Extract passes X by value instead of by reference.
>Anyone have any ideas?
In[1]:= data = RandomReal[1, 5];
data + SparseArray[{2 -> 1}, Length@data]
Out[2]= {0.792931,1.11432,0.235235,0.730301,0.48574}
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web