Applying transformation rule to matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg9720] Applying transformation rule to matrix
- From: "Gary L. Hennigan" <glhenni at cs.sandia.gov>
- Date: Tue, 25 Nov 1997 00:06:15 -0500
- Organization: Sandia National Labs
- Sender: owner-wri-mathgroup at wolfram.com
I have a symbolic matrix created as pos=Array[p,{4,3}] and a corresponding matrix that stores actual values, e.g., posval={{1,2,3},{4,5,6},{7,8,9},{1,2,3}} I perform some operations on "pos" to get several other variables and now I'd like to apply a transformation rule to see what the numerical value of those resulting variables is with the values in "posval". Assuming "var1" is some function of the elements in the matrix "pos", is there an easier way to do this than: var1 /. {pos[[1,1]]->posval[[1,1]],...,pos[[4,3]]->posval[[4,3]]} The string of transformation rules in {}'s gets quite long for a 4x3 matrix and it's a bit annoying having to cut and paste the thing around. I don't want to assign pos=posval because I may define other symbolic variables that are functions of "pos" later. Of importance may be that I'm using v2.2 on a Sparc under Solaris. I'm still learning Mathematica so be gentle if this is a dumb question! Thanks, Gary