| Author |
Comment/Response |
Michael
|
07/02/12 00:43am
See if this does the things you want do:
In[1]:= address1 = {2, 2, 1, 5, 3, 1};
In[2]:= array1 = RandomReal[10, {2, 3, 4, 5, 4, 3}]; (* test case for array1; note the elements are all Real *)
In[3]:= array1 = ReplacePart[array1, address1 -> -2]; (* replace element at address by the Integer -2; store result back in array1 *)
In[4]:= Position[array1, _Integer] (* finds all Integers in array1 *)
Out[4]= {{2, 2, 1, 5, 3, 1}}
In[5]:= Extract[array1, address1] (* You can use Extract instead of array1[[##]]&... *)
Out[5]= -2
URL: , |
|