Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Writing to array using variable with address' topicStudent Support Forum > General > Archives > "Writing to array using variable with address"

Next Comment >Help | Reply To Topic
Author Comment/Response
Leon
06/28/12 04:52am

Hello. I have a little problem and I hope you can help me.

First, I have a multi-dimensional array (let's call it "array1") and I don't know a priori how many dimensions it has.
Second, I have an address of some element of array1 and it looks like:
address1={2,2,1,5,3,1};
I know that I can extract this element using such code:
(array1[[##]] & @@@ {address1})[[1]]
It will work just like "array1[[2,2,1,5,3,1]]". But the next line is not going to work:
(array1[[##]] & @@@ {address1})[[1]] = 15;
That is my question. How to change the value of an element of array1 which can be found using address1?

Sorry if my English is not completely correct.

URL: ,

Subject (listing for 'Writing to array using variable with address')
Author Date Posted
Writing to array using variable with address Leon 06/28/12 04:52am
Re: Writing to array using variable with address Nasser M. Ab... 06/29/12 07:29am
Re: Re: Writing to array using variable with ad... Leon 06/29/12 09:48am
Re: Re: Re: Writing to array using variable wit... Nasser M. Ab... 06/29/12 1:07pm
Re: Writing to array using variable with address Michael 07/02/12 00:43am
Re: Re: Writing to array using variable with ad... Leon 07/02/12 10:56am
Next Comment >Help | Reply To Topic