| Author |
Comment/Response |
Gopinath Venkatesan
|
08/24/07 12:15pm
Friends,
I think this is simple yet I could not get it. I have several equations that have many arrays, and some of the arrays are defined using common variables. I am posting a sample case below to give a picture of how it looks like.
m = 3;
kx = Table[A[i, j], {i, 1, m}, {j, 1, m}];
sx = Table[0, {i, 1, m}, {j, 1, m}];
Table[kx[[i, j]] = i j, {i, 1, m}, {j, 1, i - 1}];
Table[kx[[i, j]] = i j, {i, 1, m}, {j, i + 1, m}];
kx // MatrixForm
Table[sx[[i, i]] = i kx[[i, i]], {i, 1, m}];
sx // MatrixForm
kx /. sx -> 0 // MatrixForm
kx // MatrixForm
Table[kx[[i, i]] = 0, {i, 1, m}];
Print["What I was expecting is ", kx // MatrixForm]
My question is -- What should be used to apply transformation rules to elements of arrays so that resulting assignments are carried on to other definitions.
I tried, With[], Assuming[], but no use.
Thanks for suggestions.
Gopinath
Attachment: mathforumquestion_v1_082407.nb, URL: , |
|