Re: my previous question on matrix element assignment
- To: mathgroup at smc.vnet.net
- Subject: [mg17237] Re: my previous question on matrix element assignment
- From: rfinley at netdoor.com (Richard Finley)
- Date: Fri, 30 Apr 1999 02:34:33 -0400
- Organization: Internet Doorway, Inc. -- http://www.netdoor.com/
- References: <RRbU2.1131$JC1.52645@axe.netdoor.com>
- Sender: owner-wri-mathgroup at wolfram.com
Oops! I forgot to mention that f[{a_,b_}] := m[a,b] and the array should have been written as mat = Array[m, {3,3}] my head is not so clear after all....sorry. Thx RF Richard Finley wrote in message ... >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[m,{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 > >