wow! that works!! i personally used the 1*(i==j) version of things because i discovered it on my own one day - and loved how short and LISPy the expression looked. Obviously your way is a lot better.
I'm not sure what you mean. Calling .subs this way does apply the substitution to each element of the matrix.
DSM (Apr 15 '12)i mean something like f.subs({S:matrix([[0,1],[1,0]])}), where S is a $2\times 2$ matrix. Please note the word like!
Unfortunately I'm still not sure what you want. f is a three-by-three matrix with entries in R. What would applying a substitution to f from one two-by-two matrix to another two-by-two matrix mean?
DSM (Apr 15 '12)
If you click on the "edit" button you'll see there are HTML tags strewn about. If you clean it up and space things it should work.
DSM (Apr 15 '12)@DSM - it actually looks worse now! but i have taken out the tags!
d3banjan (Apr 15 '12)".. and space things". You need linebreaks too.
DSM (Apr 15 '12)