MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

assignment of matrix elements

  • To: mathgroup at
  • Subject: [mg17206] assignment of matrix elements
  • From: "Richard Finley" <rfinley at>
  • Date: Mon, 26 Apr 1999 01:20:45 -0400
  • Sender: owner-wri-mathgroup at

This seems like it should be straightforward but I am too tired to think 
about it anymore:

If you have a matrix say mat = Array[m, {4,4}]

and a list of indices say v = {{1,2},{1,3},{2,3},{3,1}}
with another list of the same length giving the values of the matrix 
elements at
those indices: w = {1,5,-2,1}

How do you assign values to the matrix elements with those 
that m[1,2]=1, m[1,3]=5 etc...

Obviously you can do it individually by simple assignment:

That won't work for me because there are thousands of elements...the 
techniques I have tried so far
have not worked...any help is greatly appreciated.  


Richard Finley

  • Prev by Date: infuriating Series[] question
  • Next by Date: directory and file structure
  • Previous by thread: Re: infuriating Series[] question
  • Next by thread: Re: assignment of matrix elements