re: my previous question on matrix element assignment
- To: mathgroup at smc.vnet.net
- Subject: [mg17236] re: my previous question on matrix element assignment
- From: rfinley at netdoor.com (Richard Finley)
- Date: Fri, 30 Apr 1999 02:34:32 -0400
- Organization: Internet Doorway, Inc. -- http://www.netdoor.com/
- Sender: owner-wri-mathgroup at wolfram.com
Nothing like posting a question to the group to make you see the answer...I had asked how to make assignments to certain matrix elements of (for example) mat = Array[mat,{3,3}] where the indices of the matrix elements to be assigned are in the list v = {{1,2},{1,3},{2,3},{3,1}} and the values they are to be assigned are in the list w = {1, 4, 2, 5}, so m[1,2]=1, m[1,3]=4, etc... My head is now clear enough to see the answer: sol=mat/.Thread[f/@v->w] Thanks to anyone who thinks about it anyway and I am interested to see any other approaches. Richard Finley